davidhalter / davidhalter/jedi

Python 3.13.0b3+ `functools.partial` being a descriptor messes with signatures

Open
#2,012 1 comment 0 reactions 0 assignees View on GitHub
feature low-prio repl
Dominant language
Python
Stars
6.2k
Forks
535
PR merge metrics
No merged PRs in 30d

Description

As we found out on #2003, in Python 3.13+ `functools.partial` is now a descriptor. In turn this means that `Interpreter` (which uses a mix of access to real objects and code analysis) fails to resolve a suitable name for partially applied functions and ends up using the `__repr__` instead.

The specific issue is that `DirectObjectAccess.py__name__` is confused by the result of its `inspect.ismethoddescriptor` check.

See also discussion on #2003, from which this is broken out.

Contributor guide

Open the contributing guide

Research direction

Start in DirectObjectAccess.py__name__ and inspect how the inspect.ismethoddescriptor result handles functools.partial under Python 3.13+. Reproduce the Interpreter name-resolution failure and verify that partially applied functions no longer fall back to __repr__.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.