Skip to content

Commit

Permalink
Fix some minor issues (#6891)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmontagu committed Jul 27, 2023
1 parent e4a6dba commit 1c02b19
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
15 changes: 0 additions & 15 deletions docs/usage/validation_decorator.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,3 @@ it never will be.
### Return value

The return value of the function may optionally be validated against its return type annotation.

### Model fields and reserved arguments

The following names may not be used by arguments since they can be used internally to store information about
the function's signature:

* `v__args`
* `v__kwargs`
* `v__positional_only`

These names (together with `"args"` and `"kwargs"`) may or may not (depending on the function's signature) appear as
fields on the internal Pydantic model accessible via `.model` thus this model isn't especially useful
(e.g. for generating a schema) at the moment.

This should be fixable in future as the way error are raised is changed.
2 changes: 1 addition & 1 deletion pydantic/_internal/_std_types_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def infer_default() -> Callable[[], Any]:
bool: bool,
}
values_type_origin = get_origin(values_source_type) or values_source_type
instructions = 'set using `DefaultDict[..., Annotated[..., Field(default_factory=...)]]'
instructions = 'set using `DefaultDict[..., Annotated[..., Field(default_factory=...)]]`'
if isinstance(values_type_origin, TypeVar):

def type_var_default_factory() -> None:
Expand Down
3 changes: 1 addition & 2 deletions pydantic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,7 @@ def create_model(
__cls_kwargs__: A dictionary of keyword arguments for class creation.
__slots__: Deprecated. Should not be passed to `create_model`.
**field_definitions: Attributes of the new model. They should be passed in the format:
`<name>=(<type>, <default value>)` or `<name>=<default value>`. For more complex cases, they can be
passed in the format: `<name>=<Field>` or `<name>=(<type>, <FieldInfo>)`.
`<name>=(<type>, <default value>)` or `<name>=(<type>, <FieldInfo>)`.
Returns:
The new [model][pydantic.BaseModel].
Expand Down

0 comments on commit 1c02b19

Please sign in to comment.