Message315964
in Python 3.5 it the pprint.PrettyPrinter mechanism got an overhaul, relying on PrettyPrinter._dispatch dict-lookup based on obj.__repr__ type.
This breaks any Cythonized 3rd party libraries that used to be pretty-printable in Python3.4.
type(object).__repr__
<instancemethod __repr__ at 0x10cf2a618>
since instancemethod_hash function has been commented out:
https://github.com/python/cpython/blob/c30098c8c6014f3340a369a31df9c74bdbacc269/Objects/classobject.c#L569
oddly the behavior is different between Linux and Mac.
The same object in Linux returns cyfunction, and is hashable,
where as under the same CPython version in Mac, it returns instancemethod, rendering it unhashable.
(based on Cython 0.27.3)
note that this isn't exactly something related directly to the implementation of Cython.
the old logic in Python <3.4 pprint was not pretty (pun not intended), but relied solely on type checking,
where as the new implementation depends on hashing, which introduces this bug. |
|
Date |
User |
Action |
Args |
2018-04-30 20:39:51 | siming85 | set | recipients:
+ siming85 |
2018-04-30 20:39:51 | siming85 | set | messageid: <1525120791.11.0.682650639539.issue33395@psf.upfronthosting.co.za> |
2018-04-30 20:39:51 | siming85 | link | issue33395 messages |
2018-04-30 20:39:51 | siming85 | create | |
|