mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Ignore py__name__ issues for functools.partial in Python 3.13.0b3+
See https://github.com/davidhalter/jedi/issues/2012 for details.
This commit is contained in:
@@ -526,10 +526,14 @@ def test_partial_signatures(code, expected, index):
|
|||||||
c = functools.partial(func, 1, c=2)
|
c = functools.partial(func, 1, c=2)
|
||||||
|
|
||||||
sig, = jedi.Interpreter(code, [locals()]).get_signatures()
|
sig, = jedi.Interpreter(code, [locals()]).get_signatures()
|
||||||
assert sig.name == 'partial'
|
|
||||||
assert [p.name for p in sig.params] == expected
|
assert [p.name for p in sig.params] == expected
|
||||||
assert index == sig.index
|
assert index == sig.index
|
||||||
|
|
||||||
|
if sys.version_info < (3, 13):
|
||||||
|
# Python 3.13.0b3 makes functools.partial be a descriptor, which breaks
|
||||||
|
# Jedi's `py__name__` detection; see https://github.com/davidhalter/jedi/issues/2012
|
||||||
|
assert sig.name == 'partial'
|
||||||
|
|
||||||
|
|
||||||
def test_type_var():
|
def test_type_var():
|
||||||
"""This was an issue before, see Github #1369"""
|
"""This was an issue before, see Github #1369"""
|
||||||
|
|||||||
Reference in New Issue
Block a user