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/2017-November/150554.html below:

[Python-Dev] PEP 562

[Python-Dev] PEP 562Ethan Furman ethan at stoneleaf.us
Wed Nov 15 13:02:34 EST 2017
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__`` method
 >>
 >> [...]
 >>
>> Specification
>> =============
>>
 >> The ``__getattr__`` function at the module level should accept one argument
>> which is the name of an attribute and return the computed value or raise
>> an ``AttributeError``::
>
>>    def __getattr__(name: str) -> Any: ...
>
>> This function will be called only if ``name`` is not found in the module
>> through the normal attribute lookup.
>
> The Rationale (quoted in the beginning of this email) easily leaves a different impression of this.​

I don't see how.  This is exactly the way normal __getattr__ works.

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