Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pprint handles depth argument incorrectly #44928

Closed
dimaq mannequin opened this issue May 4, 2007 · 5 comments
Closed

pprint handles depth argument incorrectly #44928

dimaq mannequin opened this issue May 4, 2007 · 5 comments
Labels
stdlib Python modules in the Lib dir

Comments

@dimaq
Copy link
Mannequin

dimaq mannequin commented May 4, 2007

BPO 1712742
Nosy @birkenfeld
Superseder
  • bpo-1713041: fix for 1712742: corrects pprint's handling of 'depth'
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2008-05-12.16:25:52.318>
    created_at = <Date 2007-05-04.13:47:32.000>
    labels = ['library']
    title = 'pprint handles depth argument incorrectly'
    updated_at = <Date 2008-05-12.16:25:52.164>
    user = 'https://bugs.python.org/dimaq'

    bugs.python.org fields:

    activity = <Date 2008-05-12.16:25:52.164>
    actor = 'georg.brandl'
    assignee = 'nnorwitz'
    closed = True
    closed_date = <Date 2008-05-12.16:25:52.318>
    closer = 'georg.brandl'
    components = ['Library (Lib)']
    creation = <Date 2007-05-04.13:47:32.000>
    creator = 'dimaq'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 1712742
    keywords = []
    message_count = 5.0
    messages = ['31948', '31949', '31950', '31951', '66735']
    nosy_count = 5.0
    nosy_names = ['nnorwitz', 'georg.brandl', 'collinwinter', 'draghuram', 'dimaq']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '1713041'
    type = None
    url = 'https://bugs.python.org/issue1712742'
    versions = []

    @dimaq
    Copy link
    Mannequin Author

    dimaq mannequin commented May 4, 2007

    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.

    @dimaq dimaq mannequin assigned nnorwitz May 4, 2007
    @dimaq dimaq mannequin added the stdlib Python modules in the Lib dir label May 4, 2007
    @dimaq dimaq mannequin assigned nnorwitz May 4, 2007
    @dimaq dimaq mannequin added the stdlib Python modules in the Lib dir label May 4, 2007
    @draghuram
    Copy link
    Mannequin

    draghuram mannequin commented May 4, 2007

    I created patch 1712742 to fix this. BTW, I think that a depth of 1 should mean the top level object.

    @collinwinter
    Copy link
    Mannequin

    collinwinter mannequin commented Jun 5, 2007

    The correct patch number is 1713041. Neal, assigning to you so you can close this at the same time as the patch.

    @draghuram
    Copy link
    Mannequin

    draghuram mannequin commented Jun 5, 2007

    Of course. Thanks for the correction.

    @birkenfeld
    Copy link
    Member

    Closing as dupe of the patch issue.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant