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/115875.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__ packageSteven D'Aprano steve at pearwood.info
Fri Jan 27 21:48:55 CET 2012
Eli Bendersky wrote:

>> try:
>>    from __preview__ import thing
>> except ImportError:
>>    import thing
>>
>> So no need to target a very specific version of Python.
>>
> 
> Yep, this is what I had in mind. And it appeared too trivial to place
> it in the PEP.

Trivial and wrong.

Since thing and __preview__.thing may have subtle, or major, API differences, 
how do you use it?

try:
     result = thing.foo(a, b, c) + thing.bar(x)
except AttributeError:
     # Must be the preview version
     result = thing.foobar(a, c, b, x)


-- 
Steven

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