True
Andrew Bennetts
andrew-pythonlist at puzzling.org
Mon Oct 20 05:50:05 EDT 2003
More information about the Python-list mailing list
Mon Oct 20 05:50:05 EDT 2003
- Previous message (by thread): True
- Next message (by thread): True
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Oct 19, 2003 at 08:17:15AM -0700, David Eppstein wrote: > In article <3f929cf0$1_1 at themost.net>, > "Paul Watson" <pwatson at redlinec.com> wrote: > > > Then, what is the best way to write boolean operations for Python 2.1 so > > that it will be as 2.3+ ready as possible? > > I've been including the following at the start of some of my code: > > if 'True' not in globals(): > globals()['True'] = not None > globals()['False'] = not True Why not simply: try: True except NameError: True = (1 == 1) # or not None, if you prefer False = not True Or were you trying to change the __builtins__ by using globals()? -Andrew.
- Previous message (by thread): True
- Next message (by thread): True
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list