diff --git a/pydantic/main.py b/pydantic/main.py index 01afe5fc65..3228e833c0 100644 --- a/pydantic/main.py +++ b/pydantic/main.py @@ -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, @@ -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, @@ -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': """ @@ -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,