Issue 1712742: pprint handles depth argument incorrectly (original) (raw)

Issue1712742

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/44928

classification

Title: pprint handles depth argument incorrectly
Type: Stage:
Components: Library (Lib) Versions:

process

Status: closed Resolution: duplicate
Dependencies: Superseder: fix for 1712742: corrects pprint's handling of 'depth' View:1713041
Assigned To: nnorwitz Nosy List: collinwinter, dimaq, draghuram, georg.brandl, nnorwitz
Priority: normal Keywords:

Created on 2007-05-04 13:47 by dimaq, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg31948 - (view) Author: Dmitrii Tisnek (dimaq) Date: 2007-05-04 13:47
pprint.pprint( [[[[[ ]]]]], depth=0) AssertionError: depth must be > 0 pprint.pprint( [[[[[ ]]]]], depth=0.5) [[...]] pprint.pprint( [[[[[ ]]]]], depth=1) [[[...]]] I would like to see the root (that is [...]) with depth=0 (or depth=1 if you insist), either way, [[[...]]] for depth=1 is incorrect.
msg31949 - (view) Author: Raghuram Devarakonda (draghuram) (Python triager) Date: 2007-05-04 19:17
I created patch 1712742 to fix this. BTW, I think that a depth of 1 should mean the top level object.
msg31950 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-06-05 18:32
The correct patch number is 1713041. Neal, assigning to you so you can close this at the same time as the patch.
msg31951 - (view) Author: Raghuram Devarakonda (draghuram) (Python triager) Date: 2007-06-05 19:12
Of course. Thanks for the correction.
msg66735 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-12 16:25
Closing as dupe of the patch issue.
History
Date User Action Args
2022-04-11 14:56:24 admin set github: 44928
2008-05-12 16:25:52 georg.brandl set status: open -> closedresolution: duplicatesuperseder: fix for 1712742: corrects pprint's handling of 'depth'messages: + nosy: + georg.brandl
2007-05-04 13:47:32 dimaq create