Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_compiled_signature fails in Python 3.12 for next #1952

Open
frenzymadness opened this issue Aug 1, 2023 · 1 comment
Open

test_compiled_signature fails in Python 3.12 for next #1952

frenzymadness opened this issue Aug 1, 2023 · 1 comment

Comments

@frenzymadness
Copy link
Contributor

The failure is caused by the different signature for next builtin function:

>       assert signature.to_string() == sig
E       AssertionError: assert 'next()' == 'next(iterato...ault=None, /)'
E         - next(iterator, default=None, /)
E         + next()

This might actually be a problem in CPython because I've found some strange changes in help texts of some builtin functions as well. I've opened this issue: python/cpython#107526

What I don't understand is how Jedi gets signatures of builtin functions. inspect.signature does not work for builtins. Could you please help me understand how Jedi works here? It can help me find the right place in CPython to fix.

@davidhalter
Copy link
Owner

Jedi parses the __doc__ attribute, that's how it works. So either having a proper functioning inspect.signature or having a __doc__ in the format of builtins will make it possible for Jedi to have this kind of information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants