[Python-Dev] LinkedHashSet/LinkedHashMap equivalents (original) (raw)
Josiah Carlson jcarlson at uci.edu
Thu Mar 10 20🔞24 CET 2005
- Previous message: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents
- Next message: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Raymond Hettinger" <python at rcn.com> wrote:
[BJörn Lindqvist] > I would LOVE for **kwargs to be an ordered dict. It would allow me to > write code like this: > > .class MyTuple: > . def init(self, **kwargs): > . self.dict = ordereddict(kwargs) This doesn't work. The kwargs are already turned into a regular dictionary before ordereddict sees it.
From what I understand, he was saying that it would be nice if kwargs were an ordered dict /instead of/ a standard dict.
Whether or not he realizes it will not happen due to the 2x memory overhead, 2x speed hit, etc., every time kwargs are used, is another matter.
Alternatively, BJorn could use a list of tuples and *args to preserve order, but that is an off-list discussion for another day.
- Josiah
- Previous message: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents
- Next message: [Python-Dev] LinkedHashSet/LinkedHashMap equivalents
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]