[Python-ideas] Why does BoundArguments use an OrderedDict?

Nick Coghlan ncoghlan at gmail.com
Thu Dec 18 01:37:00 CET 2014

On 18 December 2014 at 07:26, Eric Snow <ericsnowcurrently at gmail.com> wrote:
>> - 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

More information about the Python-ideas mailing list