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/2016-June/144975.html below:

[Python-Dev] PEP 520: Ordered Class Definition Namespace

[Python-Dev] PEP 520: Ordered Class Definition Namespace [Python-Dev] PEP 520: Ordered Class Definition NamespaceEthan Furman ethan at stoneleaf.us
Thu Jun 9 18:11:50 EDT 2016
On 06/09/2016 02:39 PM, Nick Coghlan wrote:
> On 7 June 2016 at 20:17, Eric Snow wrote:
>> On Tue, Jun 7, 2016 at 6:20 PM, Ethan Furman wrote:

>>> If __definition_order__ is supposed to be immutable as well as read-only
>>> then we should convert non-tuples to tuples.  No point in letting that
>>> user bug slip through.
>>
>> Do you mean if a class explicitly defines __definition_order__?  If
>> so, I'm not clear on how that would work.  It could be set to
>> anything, including None or a value that does not iterate into a
>> definition order.  If someone explicitly set __definition_order__ then
>> I think it should be used as-is.
>
> I'm guessing Ethan is suggesting defining it as:
>
>      __definition_order__ = tuple(ns["__definition_order__"])
>
> When the attribute is present in the method body.

Yup, that it's it exactly.  Thanks, Nick!

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