8000 #25790 Updating type hints to Python3 syntax in pandas/core/array by gwrome · Pull Request #25829 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

#25790 Updating type hints to Python3 syntax in pandas/core/array #25829

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 16 commits into from
Mar 30, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#25790 Added TypeVar to hint in core/indexes/base.py
  • Loading branch information
gwrome committed Mar 22, 2019
commit 46cc9090da5231c3032049fce408c54c8a938ac2
7 changes: 5 additions & 2 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime, timedelta
import operator
from textwrap import dedent
from typing import Union
from typing import TypeVar, Union
import warnings

import numpy as np
Expand Down Expand Up @@ -164,6 +164,9 @@ def _new_Index(cls, d):
return cls.__new__(cls, **d)


INDEXTYPE = TypeVar('INDEXTYPE', bound='Index')


class Index(IndexOpsMixin, PandasObject):
"""
Immutable ndarray implementing an ordered, sliceable set. The basic object
Expand Down Expand Up @@ -3632,7 +3635,7 @@ def values(self):
return self._data.view(np.ndarray)

@property
def _values(self) -> Union[ExtensionArray, Index, np.ndarray]:
def _values(self) -> Union[ExtensionArray, INDEXTYPE, np.ndarray]:
# TODO(EA): remove index types as they become extension arrays
"""
The best array representation.
Expand Down
0