[Python-Dev] PEP 408 -- Standard library preview package (original) (raw)
Philippe Fremy phil at freehackers.org
Fri Jan 27 17:09:08 CET 2012
- Previous message: [Python-Dev] PEP 408 -- Standard library __preview__ package
- Next message: [Python-Dev] PEP 408 -- Standard library __preview__ package
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 27/01/2012 16:25, Michael Foord wrote:
On 27/01/2012 14:37, Philippe Fremy wrote:
Hi,
A small comment from a user perspective. Since a package in preview is strongly linked to a given version of Python, any program taking advantage of it becomes strongly specific to a given version of Python. Such programs will of course break for any upgrade or downgrade of python version. To make the reason for the breakage more explicit, I believe that the PEP should provide examples of correct versionned usage of the module. Something along the lines of : if sys.versioninfo[:2] == (3, X): from preview import example else: raise ImportError( 'Package example is only available as preview in Python version 3.X. Please check the documentation of your version of Python to see if and how you can get the package example.' ) A more normal incantation, as is often the way for packages that became parts of the standard library after first being a third party library (sometimes under a different name, e.g. simplejson -> json): try: from preview import thing except ImportError: import thing So no need to target a very specific version of Python.
According to the PEP, the interface may change betweeen preview and final inclusion in stdlib. It would be unwise as a developer to assume that a program written for the preview version will work correctly in the stdlib version, wouldn't it ?
I would use your "normal" incantation only after checking that no significant API change have occured after stdlib integration.
By the way, if as Antoine suggests, the package remain available in preview even after it's accepted in the stdlib, how is the user supposed to deal with possible API changes ?
cheers,
Philippe
- Previous message: [Python-Dev] PEP 408 -- Standard library __preview__ package
- Next message: [Python-Dev] PEP 408 -- Standard library __preview__ package
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]