In article <5.1.1.6.0.20030908195222.01f1a860 at telecommunity.com>, "Phillip J. Eby" <pje at telecommunity.com> wrote: > 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... :) > > 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! Ok, so what's needed isn't a new sys.feature, it's some short boilerplate code you could include in all your python apps, to make sure anyone who tries to run it on an old system is informed of the problem. Something like: import sys class PythonTooOld(Exception): pass if sys.version < '2.2': raise PythonTooOld, 'This code needs Python 2.2 or greater.' -- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4