Skip to content

Include class in region name #88

@Flamefire

Description

@Flamefire

The current region name format is <module>:<function> which is sufficient for many use cases. It falls short when Python classes are involved especially when a Python class method has the same name as a module scoped function.

Example inspired by numpy:

class Foo:
  def bar(self):
    # do something

def bar(foo):
  foo.bar()

The resulting trace will look like the function bar called itself as only 1 region is created named module:bar which is found when the ENTER of foo.bar() is called.

This can be mitigated if e.g. co_firstlineno (which sounds like the line where the function is defined) is used as an additional key part in the map.

Even better would be the inclusion of the class name in the region name like: <module>[.<class>]:<function> which also helps to read and understand the trace. For example I was surprised to see a region named "_pydev_bundle.pydev_monkey:call" as pydev_monkey is a file, so how could a file be called?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions