Python advocacy

Paul Prescod paul at prescod.net
Thu Mar 9 16:41:15 EST 2000


Cary O'Brien wrote:
> 
> ...
>
> One reason that these extensions are so great is
> the event model.  Well, the right way would be
> to say that Tk forced Tcl to operate in an event-driven
> manner, and this allows things like fileevent and
> Scotty to be so slick.
> 
> I'm doing a little Python (via Zope) and the thing
> I miss the most is the tcl event model.

Interesting. Do you feel competent to "compare and contrast" Python
callbacks versus TCL events? What's wrong with:

def foo(x): 
	DoSomething()
	DoSomethingElse()

events.handleFoo=foo
events.handleBar=bar
...

In XML processing we do a lot of event handling and I've only ever felt
constrained by Python once...and generators would have solved that
"once"...WE NEED GENERATORS.

You may or may not be up to speed on what we've been talking about
w.r.t. generators but I would like to see if TCL events can be
reexpressed as either callbacks or generators without losing anything.
Is lexical scoping perhaps what Python is "missing" for TCL-style event
handling?

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Out of timber so crooked as that which man is made nothing entirely
straight can be built. - Immanuel Kant




More information about the Python-list mailing list