-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Several type annotations in _interpreters
and _interpqueues
are wrong
#13351
Comments
PR(s) welcome! (PRs to improve introspectability in CPython would also be welcome -- I'm guessiong these would probably have all been caught by our tests if |
Thanks for documenting this @agronholm! I originally annotated these back during the beta period, I'll go through again and make sure these are up to date and put up a PR. |
Just put up a PR fixing these: #13355 |
It's |
Isn't that what I said too? |
Ah, I misinterpreted/misread it--I saw "on error" as "erroneously." Sorry 😆 |
_interpreters.exec()
is annotated as returningNone
, while on error it actually returns anamespace
(though this fact is largely undocumented)_interpreters.exec()
is annotated as only takingstr
as thecode
argument, though it's documented to also accept code objects:_interpqueues.create()
takes 3 mandatory arguments (create(maxsize, fmt, unboundop) -> qid
), but the type stub says it takes 2_interpqueues.get()
returns a 3-tuple (item, fmt, unboundop), not 2-tuple as annotated in typeshed_interpqueues.put
takes 4 arguments (qid, item, fmt, unboundop), not 3 as annotated in typeshed (admittedly its own docstring is also wrong!)I believe the annotations may have been correct at the time they were added, but changes have been made to them in the CPython repository since then.
The text was updated successfully, but these errors were encountered: