Skip to content

Refine stubs for numbers.pyi#543

Merged
gvanrossum merged 3 commits intopython:masterfrom
Michael0x2a:refine-numbers
Sep 14, 2016
Merged

Refine stubs for numbers.pyi#543
gvanrossum merged 3 commits intopython:masterfrom
Michael0x2a:refine-numbers

Conversation

@Michael0x2a
Copy link
Copy Markdown
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
Copy Markdown
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