Thanks to visit codestin.com
Credit goes to github.com

Skip to content

int.__new__ needs a stub #2686

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

Closed
DarwinAwardWinner opened this issue Dec 12, 2018 · 5 comments
Closed

int.__new__ needs a stub #2686

DarwinAwardWinner opened this issue Dec 12, 2018 · 5 comments
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@DarwinAwardWinner
Copy link
Contributor

It seems that int doesn't have a method stub for __new__, which causes mypy to complain on code that attempts to subclass int. Unfortunately, I'm not sure exactly how to write this stub. If someone can give me some guidance, I can try to write a pull request.

@sproshev
Copy link
Contributor

int.__new__ had been added in #1352 but then reverted in #1464

@DarwinAwardWinner
Copy link
Contributor Author

So I guess it's not possible to add a stub for int.__new__ without breaking other things? Does this mean I just need to use # type: ignore on the call to super(...).__new__() when subclassing int?

@srittau srittau added stubs: false positive Type checkers report false errors size-small labels Dec 12, 2018
@Bhargavasomu
Copy link

I am experiencing the same issue with bytes too.

@sproshev
Copy link
Contributor

@Bhargavasomu see #2630

@srittau srittau added stubs: incomplete Annotations or sub-modules missing from an existing package or module and removed stubs: false positive Type checkers report false errors labels Sep 17, 2020
@hauntsaninja
Copy link
Collaborator

Closed by #4555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module
Projects
None yet
Development

No branches or pull requests

5 participants