You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a downstream project, we'd like to be able to pass None, and also use a typechecker to check our project. Currently, this doesn't seems possible. For example, mypy will say:
pydevicetree/source/grammar.py:23: error: Argument 1 to "enable_packrat" of "ParserElement" has incompatible type "int | None"; expected "int" [arg-type]
It seems like a simple update to the type annotation of enable_packrat. I'm happy to send a PR for that.
The text was updated successfully, but these errors were encountered:
mikeurbach
added a commit
to mikeurbach/pyparsing
that referenced
this issue
Jul 20, 2023
The method
enable_packrat
has a type annotation forcache_size_limit: int
, as well as a default value of128
:pyparsing/pyparsing/core.py
Line 1082 in d5aafc3
However, the method's docstring and implementation indicate that passing
None
will lead to an unbounded cache:pyparsing/pyparsing/core.py
Lines 1119 to 1120 in d5aafc3
In a downstream project, we'd like to be able to pass
None
, and also use a typechecker to check our project. Currently, this doesn't seems possible. For example, mypy will say:It seems like a simple update to the type annotation of
enable_packrat
. I'm happy to send a PR for that.The text was updated successfully, but these errors were encountered: