Skip to content

Commit 60783c7

Browse files
committed
CLN: created foundation for complex type annotations (GH14468)
This is mostly just a stub file for now until a more clear picture develops What has been noticed so far: * numpy has no clear definition of what array_like means. all of these are valid: - Python scalars - tuples - lists - buffers - scalars in both python and numpy - more? * similar story but not so extreme with dtypes * python and numpy scalar helpers have been defined
1 parent 53f43af commit 60783c7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/types/hinting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3+
import numpy as np
4+
5+
from typing import TypeVar, AnyStr
6+
7+
ArrayLike = TypeVar('ArrayLike', buffer, list, dict, np.array)
8+
Scalar = TypeVar('Scalar', int, float)
9+
PythonScalar = TypeVar('PythonScalar', int, float, AnyStr)

0 commit comments

Comments
 (0)