On 1/30/2019 8:45 PM, Raymond Hettinger wrote:
On Jan 30, 2019, at 3:41 PM, Glenn Linderman<v+pyt...@g.nevcal.com>  wrote:
Would it be practical to add deprecated methods to regular dict for the OrderedDict 
reordering methods that raise with an error suggesting "To use this method, convert 
dict to OrderedDict." (or some better wording).
That's an interesting idea.  Regular dicts aren't well suited to the reordering 
operations (like lists, repeated inserts at the front of the sequence wouldn't 
be performant relative to OrderedDict which uses double-linked lists 
internally).  My instinct is to leave regular dicts alone so that they can 
focus on their primary task (being good a fast lookups).

My goal was just to give a meaningful error message if someone misses the implications in What's New, and has code that actually does expect named_tuple.as_dict to have the ordering operations.

The added, deprecated methods could be removed after a couple of versions.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to