Skip to content

Conversation

@BvB93
Copy link
Member

@BvB93 BvB93 commented Aug 24, 2021

backport of #19140
closes #19716

While #19140 was technically an enhancement, the problem was that prior to the PR the incorrect usage of
a typevar would ensure that the new dtype was ignored when using the likes of ndarray.astype.


This PR adds dtype-support to the annotations of the following 3 generic/ndarray methods:

  • astype
  • view
  • getfield

@BvB93 BvB93 added this to the 1.21.3 release milestone Aug 24, 2021
@BvB93 BvB93 linked an issue Aug 24, 2021 that may be closed by this pull request
@charris charris merged commit 75f55a2 into numpy:maintenance/1.21.x Aug 24, 2021
@charris
Copy link
Member

charris commented Aug 24, 2021

Thanks Bas.

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.

ndarray.astype typing ignores the passed dtype

2 participants