Re: (Maybe off topic) Can someone explain what a finite state machine is?

2011-07-19 Thread Michael Brown
On 2011-07-19, Matty Sarro wrote:

> Hey everyone. I am currently reading through an RFC, and it mentions
> that a client and server half of a transaction are embodied by finite
> state machines. I am reading through the wikipedia article for finite
> state machines, and sadly it's going a bit above my head. I don't
> really have a background in engineering, and would really love to
> understand what is being said. Does anyone have a simple way to
> explain it?

We can mathematically model a finite state machine (FSM) by a simple
system characterized by three quantities:

* state
* input
* output

and two functions:

* next_state_function(current_state, current_input)
* output_function(current_state, current_input)

The quantities' values are only defined between transitions, as we accept
that their values change non-continuously at each transition "tick". Thus,
at each transition the following pseudocode is run:

state <- next_state_function(state, input)

And at any point in time, the output satisfies the equation:

output = output_function(state, input)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PEP 8 and extraneous whitespace

2011-07-24 Thread Michael Brown
On 2011-07-22, John Gordon wrote:

> In <[email protected]> Neil Cerutti  writes:
>
>> You can fit much more code per unit of horizontal space with a
>> proportionally spaced font. As a result, that issue, while valid,
>> is significantly reduced.
>
> Is it?  I assume one major reason for the 80-character limit is to help
> the poor sod who will eventually get stuck working with your code on an
> 80-column fixed width terminal window.
>

It's also because many people report that it's easier to read text when
it's not wider than ~75 characters.
-- 
http://mail.python.org/mailman/listinfo/python-list