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
{{ message }}
Repository navigation
stubgenc.py does not generate correct lines for staticmethods #13574
The issue here is related to a pybind11 discussion: [https://github.com/pybind/pybind11/issues/2403].
which says "a static method of class Foo, Foo.dict['f_static'] points to the static method decorator around the function object instead, not the function object itself"
So, I temporarily fixed this issue for my own project by appending a staticmethod checker right after the is_c_classmethod in file stubgenc.py:
For overloaded static methods the @staticmethod decorator is added to the output only once at the top, because multiple overloads are inferred in value.__func__ and their stubs appended in a loop in function generate_c_function_stub:
I created #14934 to fix this issue, but he pull request seems to have gone cold. I don't get any response from the reviewers and I can't merge it since I don't have the necessary permissions. How should I proceed? I would like to have this bug fixed.
Reacted by Felix Kloss, nurbscoder and Ezio Helios
Activity
EzioHelios commentedon Sep 1, 2022
For overloaded static methods the
@staticmethoddecorator is added to the output only once at the top, because multiple overloads are inferred invalue.__func__and their stubs appended in a loop in functiongenerate_c_function_stub:Passing an additional decorator string argument to
generate_c_function_stub, and use it in that loop can fix this problem:WeilerMarcel commentedon Jul 10, 2023
I created #14934 to fix this issue, but he pull request seems to have gone cold. I don't get any response from the reviewers and I can't merge it since I don't have the necessary permissions. How should I proceed? I would like to have this bug fixed.
Support type stub generation for `staticmethod` (#14934)