Irit Katriel <[email protected]> added the comment:
This change makes a difference in semantics (perhaps a good one) in this case:
import pprint
class MyDict(dict):
def __repr__(self):
return 'I do my own thing'*50
if __name__ == '__main__':
d=MyDict()
for i in range(50):
d['a%s'%i] = i
pprint.pprint(d)
Before the change MyDict.__repr__ is ignored and the dict contents are printed.
After the change it prints "I do my own thing" 50 times.
----------
nosy: +iritkatriel
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39994>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com