Skip to content

Conversation

copybara-service[bot]
Copy link

Avoid direct __annotations__ access but use get_type_hints instead.

Also we're not using inspect.get_annotations, not only because it is 3.10+ only, but also we want the additional conversion behavior of get_type_hints including:

  • Resolving string/ForwardRef types
  • Annotation inheritance
  • Unwrapping typing.Annotated

However this is also supported in inspect.get_annotations(eval_str=True), and the decision could be changed in the future.

References:

@copybara-service copybara-service bot force-pushed the test_540477123 branch 3 times, most recently from 2bf1729 to 6b02aec Compare June 26, 2023 18:28
@copybara-service copybara-service bot closed this Jun 26, 2023
@copybara-service copybara-service bot deleted the test_540477123 branch June 26, 2023 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants