8000 typing: fix recursive typing of `main.IncEnx` by tlambert03 · Pull Request #9924 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@tlambert03
Copy link
Contributor

Change Summary

I noticed the following line/comment in main.py when typing the IncExc keys:

# should be `set[int] | set[str] | dict[int, IncEx] | dict[str, IncEx] | None`, but mypy can't cope
IncEx: TypeAlias = Union[Set[int], Set[str], Dict[int, Any], Dict[str, Any], None]

I believe one just needs to include the IncEx in strings (even though __future__.annotations is imported).
(python/mypy#731)

This PR makes that change.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@github-actions github-actions bot added the relnotes-fix Used for bugfixes. label Jul 19, 2024
@codspeed-hq
Copy link
codspeed-hq bot commented Jul 19, 2024

CodSpeed Performance Report

Merging #9924 will not alter performance

Comparing tlambert03:typing-inc-exc (4f87154) with main (7cfaeba)

Summary

✅ 13 untouched benchmarks

Copy link
Contributor
@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call!

@sydney-runkle sydney-runkle merged commit cc90fb0 into pydantic:main Jul 19, 2024
@tlambert03 tlambert03 deleted the typing-inc-exc branch July 19, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes-fix Used for bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0