D
Dan Christensen
I'd like to be able to do something like:
if pythonversion >= 2.4:
g = (x for x in [1,2,3])
else:
g = iter([1,2,3])
But even though the first branch doesn't execute in python 2.3, the
parser still complains.
I can think of some tricks using strings and eval. Is there anything
more elegant?
(By the way, what's the canonical way for a script to find out which
version of python it is running in?)
Dan
if pythonversion >= 2.4:
g = (x for x in [1,2,3])
else:
g = iter([1,2,3])
But even though the first branch doesn't execute in python 2.3, the
parser still complains.
I can think of some tricks using strings and eval. Is there anything
more elegant?
(By the way, what's the canonical way for a script to find out which
version of python it is running in?)
Dan