Skip to content

Commit c0b2a7f

Browse files
simonjayhawkinsTomAugspurger
authored andcommitted
pandas\core\common.py:273: error: Implicit generic "Any". Use "typing.List" and specify generic parameters
1 parent 7670262 commit c0b2a7f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/core/common.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime, timedelta
1010
from functools import partial
1111
import inspect
12-
from typing import Any, Iterable, Union
12+
from typing import Any, Iterable, TypeVar, Union
1313

1414
import numpy as np
1515

@@ -270,7 +270,10 @@ def maybe_make_list(obj):
270270
return obj
271271

272272

273-
def maybe_iterable_to_list(obj: Union[Iterable, Any]) -> Union[list, Any]:
273+
_T = TypeVar("_T")
274+
275+
276+
def maybe_iterable_to_list(obj: Union[Iterable[_T], _T]) -> Union[Iterable[_T], _T]:
274277
"""
275278
If obj is Iterable but not list-like, consume into list.
276279
"""

0 commit comments

Comments
 (0)