Concurrency models (was: Timer)
aleax at aleax.it
Tue Oct 28 12:14:38 CET 2003
Anthony Briggs wrote:
> No, I wrote something that I consider true. I'd consider that after
> command to be on a par with Fortran's(?) COME FROM statement in terms
Intercal. Lawrence Clark's 1973 article about "comefrom" in Fortran
was satire (just as all of Intercal is).
> of being able to create subtle bugs.
Note that, in Python, you have that 'after' available any time
you're running a Tkinter GUI: any Tkinter widget has an 'after'
method that takes a delay (in milliseconds), a callable object,
and optionally some arguments, and schedules the callable to
be called with those arguments after that delay.
It works a charm, btw.
>>my money, the event-oriented model behind the [after]
>>above is at least as robust as any other.
> Yes, that's what I said - only with fewer words :)
I thought you were arguing AGAINST the 'after' functionality,
and therefore against event-driven programming...?!
Surely, if I do have a program that's architected around
responding to asynchronous events (as GUIs invariably are,
as network programming can be with asyncore or Twisted),
the ability to explicitly schedule an event (thus a callback)
for some time in the future is no problem - just handy!
More information about the Python-list