Skip to content

TYP: add some types to pandas/core/arrays/numpy_.py #29969

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

Conversation

simonjayhawkins
Copy link
Member

broken off #28339

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Dec 2, 2019
@@ -137,8 +138,8 @@ def __init__(self, values, copy=False):
if copy:
values = values.copy()

self._ndarray = values
self._dtype = PandasDtype(values.dtype)
self._ndarray: np.ndarray = values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move the definition to the class level as in some of the work @jbrockmendel has been doing as well? Off the top of my head I thought that was the PEP recommendation

self._ndarray = values
self._dtype = PandasDtype(values.dtype)
self._ndarray: np.ndarray = values
self._dtype: ExtensionDtype = PandasDtype(values.dtype)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is PandasDtype valid here? seems more specific

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove for now. mypy may no longer require this type annotation.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm when green

@simonjayhawkins
Copy link
Member Author

rebased + green

@simonjayhawkins simonjayhawkins added this to the 1.0 milestone Dec 3, 2019
@WillAyd WillAyd merged commit ed20822 into pandas-dev:master Dec 3, 2019
@WillAyd
Copy link
Member

WillAyd commented Dec 3, 2019

Thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the pandas/core/arrays/numpy_.py branch December 3, 2019 21:03
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants