On Wed, Nov 15, 2017 at 8:02 PM, Ethan Furman wrote:
> On 11/15/2017 04:55 AM, Koos Zevenhoven wrote:
>
>> On Tue, Nov 14, 2017 at 10:34 PM, Ivan Levkivskyi wrote:
>>
>
>
>> Rationale
>>> =
>>>
>>> [...] It would be convenient to simplify this
>>> procedure by
On 11/15/2017 04:55 AM, Koos Zevenhoven wrote:
On Tue, Nov 14, 2017 at 10:34 PM, Ivan Levkivskyi wrote:
Rationale
=
[...] It would be convenient to simplify this
procedure by recognizing ``__getattr__`` defined directly in a module that
would act like a normal ``__getattr__``
I think it's reasonable for the PEP to include some examples, consequences
and best practices. I don't think it's reasonable for the PEP to also
define the API and implementation of helper functions that might be added
once the mechanisms are in place. Those are better developed as 3rd party
On Tue, Nov 14, 2017 at 10:34 PM, Ivan Levkivskyi
wrote:
[..]
> Rationale
> =
>
> It is sometimes convenient to customize or otherwise have control over
> access to module attributes. A typical example is managing deprecation
> warnings. Typical workarounds are
15.11.17 12:53, Ivan Levkivskyi пише:
On 15 November 2017 at 08:43, Serhiy Storchaka > wrote:
It is worth to mention that using name as a module global will
bypass __getattr__. And this is intentional, otherwise calling
__getattr__
On 15 November 2017 at 08:43, Serhiy Storchaka wrote:
> 14.11.17 22:34, Ivan Levkivskyi пише:
>
>> This function will be called only if ``name`` is not found in the module
>> through the normal attribute lookup.
>>
>
> It is worth to mention that using name as a module
14.11.17 22:34, Ivan Levkivskyi пише:
This function will be called only if ``name`` is not found in the module
through the normal attribute lookup.
It is worth to mention that using name as a module global will bypass
__getattr__. And this is intentional, otherwise calling __getattr__ for
After discussion on python-ideas, it looks this PEP moves towards a
favorable decision. For a recent discussion see
https://mail.python.org/pipermail/python-ideas/2017-November/047806.html.
The PEP is available at https://www.python.org/dev/peps/pep-0562/
The most important recent change is the