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 does not handle circular references #209

Closed
philippjfr opened this issue Jan 22, 2018 · 1 comment
Closed

pprint does not handle circular references #209

philippjfr opened this issue Jan 22, 2018 · 1 comment
Labels
component: "serialization" pickle, json, script_repr, etc etc - help me name this :) status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues. type-bug Bug report
Milestone

Comments

@philippjfr
Copy link
Member

When there are circular references on a Parameterized object the pretty printing causes a recursion error:

class A(param.Parameterized):
    
    b = param.Parameter()
    
class B(param.Parameterized):
    
    a = param.Parameter()
    
a = A()
b = B(a=a)
a.b = b
a.pprint()

I'd suggest there should be a maximum depth for the pretty printer, anything more than 1 or two levels deep will become unreadable anyway.

@philippjfr philippjfr changed the title pprint does not handle recursion pprint does not handle circular references Jan 22, 2018
@ceball ceball added component: "serialization" pickle, json, script_repr, etc etc - help me name this :) status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues. type-bug Bug report labels Apr 13, 2020
@tonyfast tonyfast added this to the v1.10.0 milestone Aug 17, 2020
@jbednar
Copy link
Member

jbednar commented Jul 2, 2021

Fixed in #499.

@jbednar jbednar closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: "serialization" pickle, json, script_repr, etc etc - help me name this :) status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues. type-bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants