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
I ran into an issue where the autocompletion starts thinking an example from the docstring of the function is the signature of the function.
The original code where I ran into this was a bit more complicated but I managed to create a somewhat minimal reproduction (the inheritance is significant, without inheriting it works correctly):
fromcollections.abcimportSequenceclassC(Sequence):
@classmethoddefcmethod(cls, number: int, lst: list[int] = []):
""" Return a list of numbers Example: ======== C.cmethod(1337, [1, 2]) # => [1, 2, 1337] """returnlst+ [number]
The autocompletion (and the documentation pop-up) seems to not realize that 1337 and [1 and 2 are literals rather than parameter names, and the cls parameter for a class method gets turned into obj for whatever reason.
Activity
Add failing test for #966
sebastinas commentedon Aug 25, 2022
There are multiple issues as far as I can tell. First issue is that parsing of default values is broken in with type annotations.
sebastinas commentedon Aug 25, 2022
Indeed,
fixlongargsis broken with type annotations.Add another failing test for #966
Test inspection with static methods
Directly access class methods in introspection (fixes bpython#966)