diff --git a/mypy.ini b/mypy.ini index 01ca206fa747d..abec13b76cc21 100644 --- a/mypy.ini +++ b/mypy.ini @@ -59,12 +59,6 @@ ignore_errors=True [mypy-pandas.core.config_init] ignore_errors=True -[mypy-pandas.core.frame] -ignore_errors=True - -[mypy-pandas.core.generic] -ignore_errors=True - [mypy-pandas.core.groupby.generic] ignore_errors=True diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6480cd86a86a3..bee8234907aba 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -16,7 +16,7 @@ import sys import warnings from textwrap import dedent -from typing import List, Optional, Union +from typing import FrozenSet, List, Optional, Set, Type, Union import numpy as np import numpy.ma as ma @@ -360,10 +360,11 @@ class DataFrame(NDFrame): def _constructor(self): return DataFrame - _constructor_sliced = Series - _deprecations = NDFrame._deprecations | frozenset( - ['get_value', 'set_value', 'from_csv', 'from_items']) - _accessors = set() + _constructor_sliced = Series # type: Type[Series] + _deprecations = NDFrame._deprecations | frozenset([ + 'get_value', 'set_value', 'from_csv', 'from_items' + ]) # type: FrozenSet[str] + _accessors = set() # type: Set[str] @property def _constructor_expanddim(self): diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 3f0533cc51048..bf8c6acae0445 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6,6 +6,7 @@ import operator import pickle from textwrap import dedent +from typing import FrozenSet, List, Set import warnings import weakref @@ -108,12 +109,13 @@ class NDFrame(PandasObject, SelectionMixin): _internal_names = ['_data', '_cacher', '_item_cache', '_cache', '_is_copy', '_subtyp', '_name', '_index', '_default_kind', '_default_fill_value', '_metadata', '__array_struct__', - '__array_interface__'] - _internal_names_set = set(_internal_names) - _accessors = frozenset() - _deprecations = frozenset(['as_blocks', 'blocks', - 'convert_objects', 'is_copy']) - _metadata = [] + '__array_interface__'] # type: List[str] + _internal_names_set = set(_internal_names) # type: Set[str] + _accessors = set() # type: Set[str] + _deprecations = frozenset([ + 'as_blocks', 'blocks', 'convert_objects', 'is_copy' + ]) # type: FrozenSet[str] + _metadata = [] # type: List[str] _is_copy = None # ----------------------------------------------------------------------