[issue39994] Redundant code in pprint module.

2020-08-15 Thread Irit Katriel
Irit Katriel added the comment: Thanks, I'll create a new PR and credit @Palak Kumar Jha as co-author. -- ___ Python tracker ___

[issue39994] Redundant code in pprint module.

2020-08-15 Thread Eric V. Smith
Eric V. Smith added the comment: I went ahead and closed the PR. Either @Palak Kumar Jha or someone else can create a new PR. The suggestions in the original PR should be addresses. -- nosy: +eric.smith ___ Python tracker

[issue39994] Redundant code in pprint module.

2020-08-14 Thread Mariatta
Mariatta added the comment: @Palak Kumar Jha, you created a PR for this ticket but it seems that your GitHub account is inactive/has been removed. Do you have a new GitHub account? Are you still interested in continuing on this PR? -- nosy: +Mariatta

[issue39994] Redundant code in pprint module.

2020-08-12 Thread Fred Drake
Fred Drake added the comment: Ah, good find! It's been so long since the first version of that code, but the implementation was surprisingly nuanced. -- ___ Python tracker

[issue39994] Redundant code in pprint module.

2020-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: bpo-23741 did not change the behavior. The specified code was added specially to preserve the existing behavior. For other base types the condition was like `issubclass(typ, list) and r is list.__repr__`, but for dict it was just `issubclass(typ, dict)`.

[issue39994] Redundant code in pprint module.

2020-08-12 Thread Fred Drake
Fred Drake added the comment: Adding serhiy.storchaka to nosy list since it looks like he introduced the isinstance check on purpose (see bpo-23741). Though bpo-23741 asserts that no behavior was changed with the patch applied then, reading through the change leads me to think this did

[issue39994] Redundant code in pprint module.

2020-08-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this code was kept for backward compatibility when the dispatch mapping was added. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue39994] Redundant code in pprint module.

2020-08-12 Thread Irit Katriel
Irit Katriel 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]

[issue39994] Redundant code in pprint module.

2020-03-19 Thread Palak Kumar Jha
Change by Palak Kumar Jha : -- nosy: +fdrake versions: -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue39994] Redundant code in pprint module.

2020-03-17 Thread Palak Kumar Jha
Change by Palak Kumar Jha : -- keywords: +patch pull_requests: +18397 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19046 ___ Python tracker ___

[issue39994] Redundant code in pprint module.

2020-03-17 Thread Palak Kumar Jha
New submission from Palak Kumar Jha : In the PrettyPrinter._format method, since self._dispatch has dict.__repr__ [key] mapped to self._pprint_dict [value] the elif block is not needed. Its work is already being done by the if block above, which searches self._dispatch to fetch the