Do not redeclare __new__ in python stubs

This commit is contained in:
baldurk
2025-09-11 12:59:22 +01:00
parent d0b7d602a7
commit fb6d4735b3
@@ -643,8 +643,9 @@ class ModuleRedeclarator(object):
elif str(descriptor).startswith('<staticmethod'):
deco = "staticmethod"
if p_name == "__new__":
deco = "staticmethod"
deco_comment = " # known case of __new__"
# do not redeclare __new__, it is not needed in the stub
# and causes problems with the known type of simple declarations
return
action("redoing innards of func %r of class %r", p_name, p_class)
if deco and HAS_DECORATORS: