You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build_scope decides whether a callable has a receiver by exact string membership against
unparsed decorator text (codeanalyzer/dataflow/access_paths.py:255-257):
decorators= {ast.unparse(d) fordinfunc.decorator_list}
ifparams[0] in ("self", "cls") and"staticmethod"notindecorators:
scope.self_name=params[0]
Only the bare spelling staticmethod is recognised. Any other spelling of the same builtin — @builtins.staticmethod, or from builtins import staticmethod as sm — fails the membership
test, so a static method gets a receiver it does not have, and scope.self_name is later added
as a definition (access_paths.py:472-473), producing a spurious def in the L3/L4 dataflow.
Activity