Eric Pederson added the comment:
Yes - that was the first thing I tried and why I logged the bug. I will log a
bug with Pycharm but it still seems like the long term solution is to make
_SubParsersAction public since it is used like a public object. I thought that
logging the bug here
Eric Pederson added the comment:
But is _SubParsersAction really private if there are methods on it that are
required to use (add_parser())?
--
___
Python tracker
<https://bugs.python.org/issue41
New submission from Eric Pederson :
ArgumentParser.add_subparsers() returns a _SubParsersAction. This requires
user code using type annotations to use a protected type which causes type
checkers like PyCharm to complain. For example:
def add_subparser(name: str, subparser