diff options
author | Maxwell Bileschi <mlbileschi@google.com> | 2020-05-15 08:43:05 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2020-05-15 08:43:28 -0700 |
commit | 44c3e1becc77c5c096727c48cacfb3eb78839d82 (patch) | |
tree | 48ea09642992cf9545cd27dbe98ed2631c8b2a52 /absl/flags/_argument_parser.py | |
parent | 3689f7e275b6bb5d2c28cf775c04b5109ba46a08 (diff) | |
download | absl-py-44c3e1becc77c5c096727c48cacfb3eb78839d82.tar.gz |
Revert adding type annotations for ArgumentParser and Flag.
Some Google-internal code wasn't ready for this yet.
PiperOrigin-RevId: 311736234
Change-Id: I4ff0f0405124b304fa30dab03447ce8ef591a94a
Diffstat (limited to 'absl/flags/_argument_parser.py')
-rw-r--r-- | absl/flags/_argument_parser.py | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/absl/flags/_argument_parser.py b/absl/flags/_argument_parser.py index a1f0daf..20b61ed 100644 --- a/absl/flags/_argument_parser.py +++ b/absl/flags/_argument_parser.py @@ -76,24 +76,6 @@ class _ArgumentParserCache(type): return type.__call__(cls, *args) -# NOTE about Genericity and Metaclass of ArgumentParser. -# (1) In the .py source (this file) -# - is not declared as Generic -# - has _ArgumentParserCache as a metaclass -# (2) In the .pyi source (type stub) -# - is declared as Generic -# - doesn't have a metaclass -# The reason we need this is due to Generic having a different metaclass -# (for python versions <= 3.7) and a class can have only one metaclass. -# -# * Lack of metaclass in .pyi is not a deal breaker, since the metaclass -# doesn't affect any type information. Also type checkers can check the type -# parameters. -# * However, not declaring ArgumentParser as Generic in the source affects -# runtime annotation processing. In particular this means, subclasses should -# inherit from `ArgumentParser` and not `ArgumentParser[SomeType]`. -# The corresponding DEFINE_someType method (the public API) can be annotated -# to return FlagHolder[SomeType]. class ArgumentParser(six.with_metaclass(_ArgumentParserCache, object)): """Base class used to parse and convert arguments. |