File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 50
50
* .egg-info
51
51
.eggs
52
52
.pypirc
53
+ # type checkers
54
+ pandas /py.typed
53
55
54
56
# tox testing tool
55
57
.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.
410
410
411
411
.. _contributing.ci :
412
412
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
+
413
433
Testing with continuous integration
414
434
-----------------------------------
415
435
You can’t perform that action at this time.
0 commit comments