[Python-ideas] OrderedDict for kwargs and class statement namespace
Jan Kaliszewski
zuo at chopin.edu.pl
Thu Feb 28 23:51:21 CET 2013
28.02.2013 11:15, Eric Snow wrote:
> * have the **kwargs param be an OrderedDict rather than a dict
> * have class definitions happen relative to an OrderedDict by
> default rather than a dict, and still overridable by a metaclass's
> __prepare__().
While having class namespace ordered sounds very nice, ordered **kwargs
sometimes may not be a desirable feature -- especially when you want to
keep a cooperatively used interface as simple as possible (because of
the risk that keyword argument order could then be taken into
consideration by *some* actors while others would still operate with the
assumption that argument order cannot be known...).
> Both of these will need OrderedDict in C, which is getting close
> (issue #16991).
Ad issue #16991: will the present semantics of inheriting from
OrderedDict be kept untouched? (I mean: which methods call other methods
=> which methods you need to override etc.)
If not we'll have a backward compatibility issue (maybe not very
serious but still...).
Cheers.
*j
More information about the Python-ideas
mailing list