Select to view content in your preferred language

PEP 561 compliant stub package for arcpy

657
4
02-18-2022 10:03 AM
JanetWilson
New Contributor II

Does anyone know if there is a PEP 561 compliant stub package for arcpy?

I'm wanting to use static typing (mypy), but Esri say they don't have type hints for arcpy.

4 Replies
DanPatterson
MVP Esteemed Contributor

esri produces arcpy and producing type hints probably isn't on the radar, especially with python 3.7 being the current distribution


... sort of retired...
0 Kudos
JanetWilson
New Contributor II

Sorry for late reply, Dan. Didn't see your reply.  Why do you say "especially with python 3.7...".. why wouldn't python 3.7 use mypy?

 

0 Kudos
DanPatterson
MVP Esteemed Contributor

Janet, I didn't say it wouldn't, I was referring to the stagnant python 3.7 which is being deprecated by many packages, like numpy etc.  python 3.9 (wild guess) will be the replacement.  If you examine the existing code base within esri scripts (eg C:\... your_install_folder ...\Resources\ArcToolBox\Scripts, you not find any type hints or *.pyi files let alone detailed documentation.  It keeps the python code base smaller obviously.  


... sort of retired...
0 Kudos
JanetWilson
New Contributor II

OK, thanks.

0 Kudos