File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 5050* .egg-info
5151.eggs
5252.pypirc
53+ # type checkers
54+ pandas /py.typed
5355
5456# tox testing tool
5557.tox
Original file line number Diff line number Diff line change @@ -410,6 +410,26 @@ A recent version of ``numpy`` (>=1.21.0) is required for type validation.
410410
411411.. _contributing.ci :
412412
413+ Testing type hints in code using pandas
414+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
415+
416+ .. warning ::
417+
418+ * Pandas is not yet a py.typed library (:pep: `561 `)!
419+ The primary purpose of locally declaring pandas as a py.typed library is to test and
420+ improve the pandas-builtin type annotations.
421+
422+ Until pandas becomes a py.typed library, it is possible to easily experiment with the type
423+ annotations shipped with pandas by creating an empty file named "py.typed" in the pandas
424+ installation folder:
425+
426+ .. code-block :: none
427+
428+ python -c "import pandas; import pathlib; (pathlib.Path(pandas.__path__[0]) / 'py.typed').touch()"
429+
430+ The existence of the py.typed file signals to type checkers that pandas is already a py.typed
431+ library. This makes type checkers aware of the type annotations shipped with pandas.
432+
413433Testing with continuous integration
414434-----------------------------------
415435
You can’t perform that action at this time.
0 commit comments