Serhiy Storchaka added the comment:
Other conversion special methods work in str subclass.
>>> class I(str):
... def __int__(self):
... return 42
...
>>> int(I('35'))
42
>>> int(I('35'), 8)
29
----------
nosy: +mark.dickinson, skrah
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25766>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com