There should be a way to graph list and tuple objects

Bug #483411 reported by Michael Elsdörfer on 2009-11-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
objgraph
Fix Released
Undecided
Unassigned

Bug Description

Currently, this isn't possible, since passing a list/tuple will always cause it's contents to be used rather than the container itself.

I propose a new parameter for this case that would allow the caller to force a certain behavior.

Marius Gedminas (mgedmin) wrote :

It was my intention that the "official" API is a sequence of objects; accepting a single object was a special case, for convenience, when you're playing with things interactively.

I do not think that

   show_graph(obj, single=True)

is nicer than

   show_graph([obj])

Perhaps a docstring update mentioning the latter as an example of handling a single object of arbitrary type would suffice?

Michael Elsdörfer (miracle2k) wrote :

You're totally correct, of course. I added that argument because I didn't even *see* that wrapping the tuple I wanted graphed within a list myself was a possibility. Very embarrassing. I must have been asleep.

Marius Gedminas (mgedmin) wrote :

Happens to all of us.

I committed a documentation fix anyway.

Changed in objgraph:
status: New → Fix Committed
Changed in objgraph:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers