[Python-Dev] PEP 520: Ordered Class Definition Namespace (round 3)
vgr255 at live.ca
Sat Jun 11 23:04:32 EDT 2016
> From: Eric Snow
> Sent: Saturday, June 11, 2016 11:02 PM
> To: Émanuel Barry
> Cc: Python-Dev
> Subject: Re: [Python-Dev] PEP 520: Ordered Class Definition Namespace
> (round 3)
> On Sat, Jun 11, 2016 at 7:51 PM, Émanuel Barry <vgr255 at live.ca> wrote:
> >> From: Eric Snow
> >> 1. if ``__definition_order__`` is defined in the class body then it
> >> must be a ``tuple`` of identifiers or ``None``; any other value
> >> will result in ``TypeError``
> > Why not just any arbitrary iterable, which get converted to a tuple at
> > runtime?
> An arbitrary iterable does not necessarily infer a definition order.
> For example, dict is an iterable but the order is undefined. Also,
> I'd rather favor simplicity for this (most likely) uncommon corner
> case of manually setting __definition_order__, particularly at the
> start. If it proves to be a problematic restriction in the future we
> can loosen it.
Point. This can always be revised later (I'm probably overthinking this as always ;)
More information about the Python-Dev