[Python-Dev] future and present

Tim Peters tim.one@home.com
Sun, 12 Aug 2001 04:49:40 -0400


There's a new Tools/scripts/cleanfuture.py to delete (or just remove the
appropriate parts of) obsolete future statements.

If you want any changes, make 'em yourself.  In particular, some Unixoid
will probably want to change it to fiddle file permissions.

Note that this serves as a nice example of why generators are truly
useful -- it doesn't use generators itself, but uses the .next() method of
the generator interface to tokenize.py.  This lets it parse files in a
natural way without building godawful state machines by hand, yet runs very
fast because future stmts can only appear near the start of a file (and so
tokenize.py only has to work until the driver determines no more future
stmts can appear).