erikrose / parsimonious

The fastest pure-Python PEG parser I can muster
MIT License
1.8k stars 126 forks source link

Type hints #183

Open ezorita opened 2 years ago

ezorita commented 2 years ago

Is there any plan to include type hints to parsimonious classes?

bitoffdev commented 2 years ago

+1 on this

In the meantime, I have found that mypy's stubgen produces type stubs that are good enough for my use case (and hopefully others reading this).

Assuming you have installed mypy, you should be able to run it like so:

stubgen -p parsimonious

and it will produce a directory full of *.pyi files.

jpy-git commented 2 years ago

FYI I've added stubs for parsimonious to typeshed in https://github.com/python/typeshed/pull/7477 You can install them via pip install types-parsimonious and then you can take advantage of type checking & improved autocomplete 😄