[issue9873] Allow bytes in some APIs that use string literals internally

Antoine Pitrou report at bugs.python.org
Wed Sep 29 11:57:41 CEST 2010

Antoine Pitrou <pitrou at free.fr> added the comment:

> A possible duck-typing approach here would be to replace the
> "instance(x, str)" tests with "hasattr(x, 'encode')" checks instead.

Looks more ugly than useful to me. People wanting to emulate str had better subclass it anyway...

nosy: +pitrou

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list