Python 3000 and "Python Regrets"

Peter Hansen peter at engcorp.com
Wed Dec 1 20:37:03 EST 2004


Dave Benjamin wrote:
> Steve Holden wrote:
>> from __past__ import __mistakes__
> 
> LOL! Better yet:
> 
> import __past__
> del __past__.__mistakes__


You can't change the past, as everyone knows, so
the names in that module are constants, like None
is in Python 2.4.

It's better simply not to spend time looking at it,
following the Pythonic DCOSM** idiom clearly suggests:

from __past__ import __mistakes__
del __mistakes__


Of course, those who forget history are doomed to repeat
it, so it might be better to do this, even though it's
in violation of common Python stylistic advice:

from __past__ import *
del __mistakes__

Unfortunately, I'm not sure whether you'll get a NameError
here, because the "from xx import *" pattern generally
doesn't retrieve names that begin with an underscore...

-sucking-up-bandwidth-for-all-its-worth-ly y'rs,
  Peter

** "Don't cry over spilt milk", of course...



More information about the Python-list mailing list