jrmccluskey commented on code in PR #27633: URL: https://github.com/apache/beam/pull/27633#discussion_r1272518482
########## sdks/python/apache_beam/typehints/typehints.py: ########## @@ -355,9 +355,12 @@ def is_typing_generic(type_param): Such objects are considered valid type parameters. - Always returns false for Python versions below 3.7. + Always returns false for Python versions below 3.7. For versions 3.9 and + above, also permits types.GenericAlias. """ - if hasattr(typing, '_GenericAlias'): + if hasattr(typing, '_GenericAlias') and hasattr(types, "GenericAlias"): + return isinstance(type_param, (typing._GenericAlias, types.GenericAlias)) Review Comment: I realized the check for typing._GenericAlias is for python versions pre-3.7 that we no longer support, so I could strip that check out and make the function simpler overall -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
