Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse re.Pattern object in regex patterns #1318

Merged
merged 17 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
revert eval fix
  • Loading branch information
sydney-runkle committed Jun 10, 2024
commit b9dad9df18ed972ec390fef7db4d4f27c25ccbcf
4 changes: 2 additions & 2 deletions generate_self_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ def all_literal_values(type_: type[core_schema.Literal]) -> list[any]:
def eval_forward_ref(type_: Any) -> Any:
try:
try:
# Python 3.12.4+
# Python 3.12+
return type_._evaluate(core_schema.__dict__, None, type_params=set(), recursive_guard=set())
except TypeError:
# Python 3.9+
return type_._evaluate(core_schema.__dict__, None, recursive_guard=set())
return type_._evaluate(core_schema.__dict__, None, set())
except TypeError:
# for Python 3.8
return type_._evaluate(core_schema.__dict__, None)
Expand Down
Loading