This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.peters
Recipients
Date 2001-12-10.22:25:43
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

Because Python has a full-blown exception system, it's 
generally better to test for the feature you need than to 
compare mysterious little integers.  For example, suppose 
you need list comprehensions.  You have no idea which 
version of Python first introduced them, and once you think 
you've got it figured out, readers of your code are going 
to have no idea that you *meant* "list comprehensions" when 
you compare sys.version_info against (2, 0).  So clearer 
all around is:

try:
.   eval("[i for i in range(2)]")
except SyntaxError:
.   raise ImportError, "I require list comprehensions"
History
Date User Action Args
2008-01-20 09:59:17adminlinkissue491331 messages
2008-01-20 09:59:17admincreate