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
(sorry if generic is the wrong word to describe this)
argparse.parse_args(namespace=MyNamespace()) returns an instance of MyNamespace, but it's annotated to always return an argparse.Namespace. This means that in order to have type-safety when accessing arguments by using a custom type-annotated class:
(sorry if generic is the wrong word to describe this)
argparse.parse_args(namespace=MyNamespace())
returns an instance ofMyNamespace
, but it's annotated to always return anargparse.Namespace
. This means that in order to have type-safety when accessing arguments by using a custom type-annotated class:you currently need to cast the return value of
argparse.parse_args
.Also, the passed object doesn't actually have to be a (subclass of)
argparse.Namespace
– a simple subclass of object is documented to work.The text was updated successfully, but these errors were encountered: