Skip to content

Show full typenames/qualnames where possible#2

Open
Zannick wants to merge 1 commit intonfergu:mainfrom
Zannick:module-names
Open

Show full typenames/qualnames where possible#2
Zannick wants to merge 1 commit intonfergu:mainfrom
Zannick:module-names

Conversation

@Zannick
Copy link
Copy Markdown

@Zannick Zannick commented Nov 11, 2024

I ran into a problem where the code I'm debugging has ambiguous function names (multiple modules that define private helper functions, classes that override abstract methods, etc) and it would be very helpful to have the module names included in the graph output. I figured out how I might do it before I decided to file a bug, so here's my suggestions for it. (Maybe instead you want to make it an option.)

For frame locals, I did not see an easy way to get the module, despite the qualname existing and naming a class. But at least we can see where that comes from more easily.

Before: multiple closures with the name "set_rules"

╙── MultiWorld instance (id=3064898151648)
    ├─╼ Referrer limit of 100 exceeded with 7534 referrers. (id=3065098216000)
    ├─╼ set_rules.<locals>.<lambda>.world (closure) (id=3065117475616)
    │   ├─╼ dict (object) (id=3064898282496) (circular ref)
    │   ├─╼ set_rules.<locals>.<lambda>.player (closure) (id=3065117475568)
    │   │   ├─╼ dict (object) (id=3064898282496) (circular ref)
    │   │   ├─╼ set_rules.<locals>.<lambda>.player (closure) (id=3065117475568) (circular ref)
    │   │   └─╼ set_rules.<locals>.<lambda>.world (closure) (id=3065117475616) (circular ref)
    │   └─╼ set_rules.<locals>.<lambda>.world (closure) (id=3065117475616) (circular ref)
[...]
    └─╼ set_rules.<locals>.location_count.multiworld (closure) (id=3065110015744)
        ├─╼ cell (object) (id=3065072318064)
        │   └─╼ tuple[1] (id=3065072280864)
        ├─╼ set_rules.<locals>.location_count.multiworld (closure) (id=3065110015744) (circular ref)
        ├─╼ set_rules.<locals>.location_count.player (closure) (id=3065110015792)
        │   ├─╼ cell (object) (id=3065072318064) (circular ref)
        │   ├─╼ set_rules.<locals>.location_count.multiworld (closure) (id=3065110015744) (circular ref)
        │   ├─╼ set_rules.<locals>.location_count.player (closure) (id=3065110015792) (circular ref)
        │   └─╼ set_rules.<locals>.<lambda>.location_count (closure) (id=3065110455040) (circular ref)

After: clear identification of specific "set_rules" closures

╙── BaseClasses.MultiWorld instance (id=1869510157248)
    ├─╼ Referrer limit of 100 exceeded with 7534 referrers. (id=1869756214560)
    ├─╼ worlds.archipidle.Rules.set_rules.<locals>.<lambda>.world (closure) (id=1869727722592)
    │   ├─╼ dict (object) (id=1869510275392) (circular ref)
    │   ├─╼ worlds.archipidle.Rules.set_rules.<locals>.<lambda>.player (closure) (id=1869727722544)
    │   │   ├─╼ dict (object) (id=1869510275392) (circular ref)
    │   │   ├─╼ worlds.archipidle.Rules.set_rules.<locals>.<lambda>.player (closure) (id=1869727722544) (circular ref)
    │   │   └─╼ worlds.archipidle.Rules.set_rules.<locals>.<lambda>.world (closure) (id=1869727722592) (circular ref)
    │   └─╼ worlds.archipidle.Rules.set_rules.<locals>.<lambda>.world (closure) (id=1869727722592) (circular ref)
[...]
    └─╼ worlds.minecraft.Rules.set_rules.<locals>.location_count.multiworld (closure) (id=1869731180192)
        ├─╼ cell (object) (id=1869684208832)
        │   └─╼ tuple[1] (id=1869684172224)
        ├─╼ worlds.minecraft.Rules.set_rules.<locals>.location_count.multiworld (closure) (id=1869731180192) (circular ref)
        ├─╼ worlds.minecraft.Rules.set_rules.<locals>.location_count.player (closure) (id=1869731180240)
        │   ├─╼ cell (object) (id=1869684208832) (circular ref)
        │   ├─╼ worlds.minecraft.Rules.set_rules.<locals>.location_count.multiworld (closure) (id=1869731180192) (circular ref)
        │   ├─╼ worlds.minecraft.Rules.set_rules.<locals>.location_count.player (closure) (id=1869731180240) (circular ref)
        │   └─╼ worlds.minecraft.Rules.set_rules.<locals>.<lambda>.location_count (closure) (id=1869731095200) (circular ref)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant