[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-dev
Subject:    Re: [Python-Dev] PEP 408 -- Standard library __preview__ package
From:       Eric Snow <ericsnowcurrently () gmail ! com>
Date:       2012-01-28 23:34:37
Message-ID: CALFfu7A9wGQ=LvCMGiE64VkCFk2ApM1OwU8h4qCAqV8Vst+W5g () mail ! gmail ! com
[Download RAW message or body]

On Sat, Jan 28, 2012 at 4:08 PM, Antoine Pitrou <solipsis@pitrou.net> wrote:
> Le samedi 28 janvier 2012 =E0 16:03 -0700, Eric Snow a =E9crit :
>> On Sat, Jan 28, 2012 at 3:02 PM, Antoine Pitrou <solipsis@pitrou.net> wr=
ote:
>> > There are many reasons to import a module, such as viewing its
>> > documentation. And the warning will trigger if the import happens in
>> > non-user code, such as a library; or when there is a fallback for the
>> > module not being present. People usually get annoyed by intempestive
>> > warnings which don't warn about an actual problem.
>>
>> As an alternative, how about a __preview__ or __provisional__
>> attribute on modules that are in this provisional state? =A0So just add
>> that big warning to the docs, as Guido suggested, and set the
>> attribute as a programmatic indicator. =A0Perhaps also add
>> sys.provisional_modules (or wherever) to explicitly give the full list
>> for the current Python version.
>
> Well, how often do you examine the attributes of a module before using
> it? I think that's a much too obscure way to convey the information.

Granted.  However, actively looking for the attribute is only one of
the lesser use-cases.  The key is that it allows you to check any
library programmatically for dependence on any of the provisional
modules.  The warning in the docs is important, but being able to have
code check for it is important too.  As a small bonus, it would show
up in help for the module and in dir().

-eric
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-dev%4=
0progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic