-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
tweaks to _core_utils
#7040
tweaks to _core_utils
#7040
Conversation
please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that we're trying to shave off as much constant overhead as we can here, overall LGTM with some suggestions and thoughts...
pydantic/_internal/_core_utils.py
Outdated
replaced_fields: dict[str, core_schema.ModelField] = {} | ||
replaced_computed_fields: list[core_schema.ComputedField] = [] | ||
for computed_field in schema.get('computed_fields', None) or (): | ||
for computed_field in schema.get('computed_fields') or (): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for computed_field in schema.get('computed_fields') or (): | |
for computed_field in schema.get('computed_fields', ()): |
pydantic/_internal/_core_utils.py
Outdated
replaced_computed_fields: list[core_schema.ComputedField] = [] | ||
for computed_field in schema.get('computed_fields', None) or (): | ||
for computed_field in schema.get('computed_fields') or (): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for computed_field in schema.get('computed_fields') or (): | |
for computed_field in schema.get('computed_fields', ()): |
pydantic/_internal/_core_utils.py
Outdated
@@ -345,7 +348,7 @@ def handle_typed_dict_schema(self, schema: core_schema.TypedDictSchema, f: Walk) | |||
def handle_dataclass_args_schema(self, schema: core_schema.DataclassArgsSchema, f: Walk) -> core_schema.CoreSchema: | |||
replaced_fields: list[core_schema.DataclassField] = [] | |||
replaced_computed_fields: list[core_schema.ComputedField] = [] | |||
for computed_field in schema.get('computed_fields', None) or (): | |||
for computed_field in schema.get('computed_fields') or (): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for computed_field in schema.get('computed_fields') or (): | |
for computed_field in schema.get('computed_fields', ()): |
Deploying with Cloudflare Pages
|
Change Summary
some trivial cleanup to
_core_utils::Walk
.Related issue number
related to #6768
Checklist
Selected Reviewer: @hramezani