1
0
forked from VimPlug/jedi

Implement __new__ signatures, fixes #2073

This commit is contained in:
Dave Halter
2026-04-28 02:25:18 +02:00
parent ff581e8403
commit 3365d0763b
2 changed files with 23 additions and 0 deletions
+12
View File
@@ -378,6 +378,18 @@ class ClassMixin:
return sigs
args = ValuesArguments([])
init_funcs = self.py__call__(args).py__getattribute__('__init__')
if len(init_funcs) == 1:
init = next(iter(init_funcs))
try:
class_context = init.class_context
except AttributeError:
pass
else:
# In the case where we are on object.__init__, we try to use
# __new__.
if class_context.get_root_context().is_builtins_module() \
and init.class_context.name.string_name == "object":
init_funcs = self.py__call__(args).py__getattribute__('__new__')
dataclass_sigs = self._get_dataclass_transform_signatures()
if dataclass_sigs: