[Python-Dev] PEP 520: Ordered Class Definition Namespace (original) (raw)
Ethan Furman ethan at stoneleaf.us
Thu Jun 9 18:11:50 EDT 2016
- Previous message (by thread): [Python-Dev] PEP 520: Ordered Class Definition Namespace
- Next message (by thread): [Python-Dev] PEP 520: Ordered Class Definition Namespace
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 definitionorder 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 definitionorder? 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 definitionorder then I think it should be used as-is. I'm guessing Ethan is suggesting defining it as: definitionorder = tuple(ns["definitionorder"]) When the attribute is present in the method body.
Yup, that it's it exactly. Thanks, Nick!
--
Ethan
- Previous message (by thread): [Python-Dev] PEP 520: Ordered Class Definition Namespace
- Next message (by thread): [Python-Dev] PEP 520: Ordered Class Definition Namespace
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]