On Thu, Mar 08, 2012 at 12:20:21PM +1000, Nick Coghlan wrote:
> On Thu, Mar 8, 2012 at 11:42 AM, Benjamin Peterson <benja...@python.org> 
> wrote:
> > 2012/3/7 Victor Stinner <victor.stin...@gmail.com>:
> >> Can't we simply raise an error if the dict contains
> >> non-string keys?
> >
> > Sounds okay to me.
> 
> For 3.3, the most we can do is trigger a deprecation warning, since
> removing this feature *will* break currently running code. I don't
> have any objection to us starting down that path, though.

Could we make string-key-only dicts a public type instead of an 
implementation detail? I've used string-only keys in my code, 
and it seems silly to have to re-invent the wheel.

I don't care if it is a built-in. I don't even care if I have to do 
something gnarly like StringDict = type(type.__dict__), so long 
as doing so is officially supported.

(But "from collections import StringDict" would be better from the point 
of discoverability.)



-- 
Steven
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to