On 17.12.16 13:44, Christian Heimes wrote:
On 2016-12-17 10:06, Serhiy Storchaka wrote:
On 16.12.16 21:24, Guido van Rossum wrote:
e.g. the argument to getattr() -- I still hear of code that breaks due
to this occasionally)

What is the problem with unicode in getattr()? Unicode attribute name is
converted to str, and since the result is cached, this even don't add
much overhead.

It breaks the str optimization of dicts. Dict with str-only keys are
special-cased in Python 2.

getattr() converts a unicode to str and passes a str to PyObject_GetAttr().

_______________________________________________
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