Skip to content

Refine stubs for numbers.pyi #543

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

Merged
merged 3 commits into from
Sep 14, 2016
Merged

Conversation

Michael0x2a
Copy link
Contributor

This commit refines the stubs for numbers.pyi. More specifically, it...

  • Adds in explicit type annotations where it's obvious how to do so (for example, the __float__ method should always return a float)
  • Adds in missing @abstractmethod decorators
  • Combines the Python 2 and Python 3 versions of numbers.pyi -- I deleted the versions of numbers in stdlib/2.7 and stdlib/3 and created a combined version in stdlib/2and3

I deliberately didn't attempt to add or change the type signatures for functions like __add__ since it looked like that would open up a huge can of worms.

This commit refines numbers.pyi. More specifically, it...

- Adds in explicit type annotations where it's obvious how to do
  so (leaving more non-obvious type signatures alone).
- Adds in missing '@AbstractMethod' decorators
- Combines together the Python 2 and Python 3 versions of numbers.pyi.
This commit removes the old `stdlib/2.7/numbers.pyi` file and moves the
previously-committed `stdlib/3/numbers.pyi` to the shared `2and3`
directory.
Since the stubs are no longer identical to what stubgen creates, the
comment should also probably be changed.
@gvanrossum
Copy link
Member

Thanks! I'll just merge this and deal with the fall-out later.

@gvanrossum gvanrossum merged commit f29a996 into python:master Sep 14, 2016
@Michael0x2a Michael0x2a deleted the refine-numbers branch September 14, 2016 15:18
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

Successfully merging this pull request may close these issues.

2 participants