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-February/116190.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
Sat Feb 4 00:18:37 CET 2012
Chris Withers wrote:

> Every time I see things like the following I cry a little inside:
> 
> try:
>   try:
>     from py2stdliblocation import FooBar as Foo
>   except ImportError:
>     from py3stdliblocation import foo as Foo
> except ImportError:
>   from pypilocation import Foo


The syntax is inelegant, but the concept is straightforward and simple and not 
worth tears.

"I need a thing called Foo, which can be found here, or here, or here. Use the 
first one found."

In principle this is not terribly different from the idea of a search PATH 
when looking for an executable, except the executable can be found under 
different names as well as different locations.


> Now we're talking about having to add __preview__ into that mix too?

As I understand it, Guido nixed that idea. (Or did I imagine that?) Preview 
modules will be just added to the std lib as normal, and you have to read the 
docs to find out they're preview.



-- 
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