[issue36793] Do not set tp_str

2019-05-04 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +12996 stage: -> patch review ___ Python tracker ___ ___ Python-bug

[issue36793] Do not set tp_str

2019-05-04 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : object.__str__() calls the __repr__() method. Therefore by default you do not need to define the __str__() method if it is the same as __repr__(): just define the __repr__() method. But there are few builtin classes which define both __repr__() and __str