[issue22570] Better stdlib support for Path objects
Serhiy Storchaka
report at bugs.python.org
Wed Jan 6 06:05:16 EST 2016
Serhiy Storchaka added the comment:
`str(object)` is not a protocol for getting a string out of an object. It's a protocol for getting a string for print(). __str__ is defined for every object and therefore is useless for getting a string out of "string-like" object (as __float__ for floats and __bytes__ for bytes). Perhaps we need a new special method __string__ that relates to __str__ as __index__ to __int__.
----------
nosy: +serhiy.storchaka
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22570>
_______________________________________
More information about the Python-bugs-list
mailing list