sumerc / yappi

Yet Another Python Profiler, but this time multithreading, asyncio and gevent aware.
MIT License
1.41k stars 73 forks source link

sum(<genexpr>) not represented correctly in call graph #134

Open olbermann opened 1 year ago

olbermann commented 1 year ago

When I have "sum" of a generator expression, e.g.

import yappi

event = "minimal_example"
yappi.clear_stats()
yappi.start()

def f():
    a = sum(x for x in range(10))

f()

yappi.stop()
minimal_example_stats = yappi.get_func_stats()
minimal_example_stats._save_as_PSTAT(f"{event}.pstat")

the generator expression gets its own node. However it is not a child of the "f" node.

I would say that it should be. E.g. if I change "sum" to "set" it is.