Issue 34125: Profiling depends on whether **kwargs is given (original) (raw)

Enable profiling for C functions:

>>> def prof(frame, typ, arg):
...     if typ.startswith("c_"):
...         print(arg, typ)
>>> import sys; sys.setprofile(prof)

and notice how profiling depends on **kwargs:

>>> list.append([], None)
<built-in method append of list object at 0x7f52da2a2dd0> c_call
<built-in method append of list object at 0x7f52da2a2dd0> c_return

>>> list.append([], None, **{})

There is no specification of what should be profiled and what not, so it's not clear what is the "correct" behavior. For the record: in Python 3.6, neither of these were profiled.