[Python-ideas] Why does BoundArguments use an OrderedDict?
antony.lee at berkeley.edu
Thu Dec 18 03:15:37 CET 2014
The discussion has drifted towards improving OrderedDict (something I
certainly approve), but the semantic question is still there: why should
BoundArguments.arguments be ordered by the parameter order? For example,
the recipe just below in the docs, for filling in the remaining default
arguments, breaks that ordering, without even mentioning that.
2014-12-17 16:37 GMT-08:00 Nick Coghlan <ncoghlan at gmail.com>:
> On 18 December 2014 at 07:26, Eric Snow <ericsnowcurrently at gmail.com>
> >> - does it have to inherit from dict? that looks like a potential can of
> >> worms
> > One of the constraints here is to make the C implementation of
> > OrderedDict match the API of the Python type exactly and the
> > underlying implementation as closely as reasonable. The Python type
> > subclasses dict so the C implementation does as well.
> This kind of design rationale is potentially useful to include inline
> as a block comment. The kinds of questions reviewers have are often
> going to be the same kinds of questions future maintainers have, and
> "why" data regarding core architectural decisions is less likely to go
> out of date as future maintainers make changes.
> > FWIW (and not directed to Antoine specifically), the implementation up
> > for review may not be ideal, but it exists and is complete. :)
> > Barring any substantial concerns during review (and the points Antoine
> > has brought up), I would rather the patch landed than wait
> > indefinitely for a more ideal implementation. That could happen
> > afterward, though I'm fairly confident in the correctness and
> > efficiency of the implementation.
> Aye, a definite +1 for "better" over "perfect".
> Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas