Skip to content

MAINT: Annotate missing attributes of np.number subclasses#19350

Merged
charris merged 2 commits intonumpy:maintenance/1.21.xfrom
BvB93:attr
Jun 25, 2021
Merged

MAINT: Annotate missing attributes of np.number subclasses#19350
charris merged 2 commits intonumpy:maintenance/1.21.xfrom
BvB93:attr

Conversation

@BvB93
Copy link
Member

@BvB93 BvB93 commented Jun 25, 2021

backport of #19344
xref #19339

A number of np.number subclass attributes were previously absent from the stub files.
This PR fixes aforementioned issue, adding annotations for the following properties and methods:

  • integer.numerator & denominator
  • integer.__round__ & floating.__round__
  • floating.as_integer_ratio
  • float64.__getnewargs__ & complex128.__getnewargs__
  • float64.is_integer, hex, fromhex, __trunc__ & __getformat__
  • float64.__ceil__ & float64.__floor__ (python >= 3.9 only)

Bas van Beek added 2 commits June 25, 2021 21:59
* `integer.numerator` & `denominator`
* `integer.__round__` & `floating.__round__`
* `floating.as_integer_ratio`
* `float64.__getnewargs__` / `complex128.__getnewargs__`
* `float64.is_integer`, `hex`, `fromhex`, `__trunc__` & `__getformat__`
* `float64.__ceil__` & `float64.__floor__` (python >= 3.9 only)
@BvB93 BvB93 added this to the 1.21.1 release milestone Jun 25, 2021
@charris charris merged commit 2e32825 into numpy:maintenance/1.21.x Jun 25, 2021
@charris
Copy link
Member

charris commented Jun 25, 2021

Thanks Bas.

@BvB93 BvB93 deleted the attr branch June 25, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants