Skip to content

Commit

Permalink
fix main.BaseModel.(dict, json) fields types (#4293)
Browse files Browse the repository at this point in the history
* fix main.BaseModel.(dict, json) fields types

fix main.BaseModel.dict fields (include, exclude, skip_defaults) types
fix main.BaseModel.json fields (include, exclude, skip_defaults) types

* fix types for BaseModel.copy, BaseModel._iter

fix types for BaseModel.copy fields: include, exclude, update
BaseModel._iter fields: include, exclude
  • Loading branch information
shestakovich committed Aug 9, 2022
1 parent 86b8486 commit f41ac92
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pydantic/main.py
Expand Up @@ -420,10 +420,10 @@ def _init_private_attributes(self) -> None:
def dict(
self,
*,
include: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
exclude: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
by_alias: bool = False,
skip_defaults: bool = None,
skip_defaults: Optional[bool] = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
Expand Down Expand Up @@ -456,10 +456,10 @@ def dict(
def json(
self,
*,
include: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
exclude: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
by_alias: bool = False,
skip_defaults: bool = None,
skip_defaults: Optional[bool] = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
Expand Down Expand Up @@ -621,9 +621,9 @@ def _copy_and_set_values(self: 'Model', values: 'DictStrAny', fields_set: 'SetSt
def copy(
self: 'Model',
*,
include: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
exclude: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
update: 'DictStrAny' = None,
include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
update: Optional['DictStrAny'] = None,
deep: bool = False,
) -> 'Model':
"""
Expand Down Expand Up @@ -805,8 +805,8 @@ def _iter(
self,
to_dict: bool = False,
by_alias: bool = False,
include: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
exclude: Union['AbstractSetIntStr', 'MappingIntStrAny'] = None,
include: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
exclude: Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']] = None,
exclude_unset: bool = False,
exclude_defaults: bool = False,
exclude_none: bool = False,
Expand Down

0 comments on commit f41ac92

Please sign in to comment.