"Martin v. Löwis", 23.08.2011 15:17:
Has this been considered before? Was there a reason to decide against it?
I think we simply didn't consider it. An early version of the PEP used
the lower bits for the pointer to encode the kind, in which case it even
stopped being a pointer. Modules are not expected to access this
pointer except through the macros, so it may not matter that much.
The difference is that you *could* access them directly in a safe way, if
it was a union.
So, for an efficient character loop, replicated for performance reasons or
for character range handling reasons or whatever, you could just check the
string kind and then jump to the loop implementation that handles that
type, without using any further macros.
Stefan
_______________________________________________
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