Normalize Protocol Goldens Generation

PiperOrigin-RevId: 403171391
Change-Id: I486aa30488c6fa90a56fa3939cc2bb9bb277ff80
This commit is contained in:
Faizan Muhammad 2021-10-14 13:21:11 -07:00 committed by TensorFlower Gardener
parent c3da9e2f00
commit ac8b31f8c2

View File

@ -97,11 +97,17 @@ _NORMALIZE_TYPE[(
'tensorflow.python.framework.ops.Tensor')] = (
"<class 'tensorflow.python.framework.ops.Tensor'>")
_NORMALIZE_TYPE['typing.Generic'] = "<class 'typing.Generic'>"
# TODO(mdan): Remove once the golden files are generated in Python 3.7.
# TODO(b/203104448): Remove once the golden files are generated in Python 3.7.
_NORMALIZE_TYPE["<class 'typing._GenericAlias'>"] = 'typing.Union'
# TODO(mdan): Remove once the golden files are generated in Python 3.9.
# TODO(b/203104448): Remove once the golden files are generated in Python 3.9.
_NORMALIZE_TYPE["<class 'typing._UnionGenericAlias'>"] = 'typing.Union'
# TODO(b/203104448): Remove once the golden files are generated in Python 3.8.
_NORMALIZE_TYPE[
"<class 'typing_extensions._ProtocolMeta'>"] = ("<class "
"'typing._ProtocolMeta'>")
# TODO(b/203104448): Remove once the golden files are generated in Python 3.8.
_NORMALIZE_TYPE[
"<class 'typing_extensions.Protocol'>"] = "<class 'typing.Protocol'>"
if sys.version_info.major == 3 and sys.version_info.minor >= 8:
_NORMALIZE_TYPE["<class '_collections._tuplegetter'>"] = "<type 'property'>"