On Sun, May 19, 2013 at 4:40 PM, Nick Coghlan <ncoghlan at gmail.com> wrote: > On Sun, May 19, 2013 at 11:01 PM, Antoine Pitrou <solipsis at pitrou.net> wrote: >> The main use case seems to be the OrderedDict constructor itself. >> Otherwise, I can't think of any situation where I would've wanted it. > > I've had a couple related to populating other mappings where order > matters, at least from a predictability and readability perspective, > even if it's not strictly required from a standards compliance point > of view (think writing XML attributes, etc). > > I quite liked the idea of a simple flag attribute on function objects > that the interpreter checked, with a decorator in functools (or even > the builtins) to set it. It's not a particularly elegant solution, but > it would get the job done with minimal performance impact on existing > functions. > > Cheers, > Nick. Note that raymonds proposal would make dicts and ordereddicts almost exactly the same speed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4