[Python-ideas] Keyword to disambiguate python version

Nick Coghlan ncoghlan at gmail.com
Fri Aug 27 00:29:21 CEST 2010


On Fri, Aug 27, 2010 at 8:11 AM, Jonny <jwringstad at gmail.com> wrote:
>> The right place to tell a user the environment your code was written for is
>> documentation. A user just needs to know where to rely on you and where to take
>> responsibility his/herself.
> I guess you are right about that. And for the really important cases,
> I suppose performing a check in the makefile, or, if everything else
> fails, directly in the code (yuck) should suffice.

Umm, how is an explicit runtime check any uglier than a pragma? You
would need to check the pragma at runtime anyway, otherwise pyc files
wouldn't get checked reliably.

If a module breaks due to version incompatibilities, developers can
generally figure it out, especially if you document the tested
versions clearly (e.g. by using the relevant PyPI trove classifiers*).

Cheers,
Nick.

* Version specific classifiers for Python modules on PyPI:
Programming Language :: Python :: 2
Programming Language :: Python :: 2.3
Programming Language :: Python :: 2.4
Programming Language :: Python :: 2.5
Programming Language :: Python :: 2.6
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.0
Programming Language :: Python :: 3.1
Programming Language :: Python :: 3.2

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list