Skip to content

Using help (?) with default_box=True unintentionally adds a key #236

@nishikantparmariam

Description

@nishikantparmariam

Box is really useful when accessing non-existing keys/attributes and assigning new keys on them e.g. box.foo.bar.baz = 1.

Noting down here an issue I have found. When IPython's help using ? is called it adds a key getdoc in Box object.

Version

python-box v6.1.0

Reproducer

box-repro

Cause

This seems expected and is a side-effect of this line in IPython which tries a find a custom method getdoc() to get docstring for an object.

Is there a workaround here?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions