New PEP: The directive statement
Martin von Loewis
loewis at informatik.hu-berlin.de
Fri Mar 23 09:14:24 CET 2001
Bruce Sass <bsass at freenet.edmonton.ab.ca> writes:
> For example, I'd rather do...
> result = new_math_based_function()
> except NewMathError:
> result = old_math_based_function()
> ...and have the compiler use the appropriate source depending on what
> the interpreter can handle, rather than do a check of the
> "sys.version" or try to catch a run-time exception.
And you would supply both new_math_based_function and
old_math_based_function in the same module, outside of the use: block?
That is probably difficult to implement, as the compiler *when
processing new_math_based_function* needs to know what / means.
More information about the Python-list