[Python-Dev] New functionality in micro releases
(was:Documenting branch policy)
Fred L. Drake, Jr.
fdrake at acm.org
Mon Sep 8 23:37:59 EDT 2003
Phillip J. Eby writes:
> It does suggest that being able to specify the version of Python required
> by a script or module, would be a helpful idiom. sys.requireversion(),
> perhaps? Guess I should make a quick check to be sure you haven't already
> used the time machine and put this in... :)
I'm not aware of any such thing.
> Of course, the sad bit is that even if there were a sys.requireversion(),
> it wouldn't be in the versions where it was actually needed: the older ones!
Comparison with sys.version_info would be trivial, and seems
sufficient:
if sys.version_info < (2,2,2):
print "Get a newer version of Python!"
else:
main()
-Fred
--
Fred L. Drake, Jr. <fdrake at acm.org>
PythonLabs at Zope Corporation
More information about the Python-Dev
mailing list