A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-January/115857.html below:

[Python-Dev] PEP 408 -- Standard library __preview__ package

[Python-Dev] PEP 408 -- Standard library __preview__ package [Python-Dev] PEP 408 -- Standard library __preview__ packageMatt Joiner anacrolix at gmail.com
Fri Jan 27 16:35:53 CET 2012
> 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.

I think this is suboptimal, having to guess where modules are located,
you end up with this in every module:

try:
    import cjson as json
except ImportError:
   try:
       import simplejson as json
  except ImportError:
      import json as json

Perhaps the versioned import stuff could be implemented (whatever the
syntax may be), in order that something like this can be done instead:

import regex('__preview__')
import regex('3.4')

Where clearly the __preview__ version makes no guarantees about
interface or implementation whatsoever.

etc.
More information about the Python-Dev mailing list

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