1212from .utils import ForwardRef
1313from .common import CHECK_TYPES
1414from .validation import TypeMismatchError , ensure_isa as default_ensure_isa
15- from .pytypes import TypeCaster , type_caster , SumType , NoneType
15+ from .pytypes import TypeCaster , SumType , NoneType
1616
1717Required = object ()
1818MAX_SAMPLE_SIZE = 16
@@ -338,7 +338,8 @@ def __dataclass_transform__(
338338@__dataclass_transform__ (eq_default = True , order_default = True )
339339def dataclass (cls = None , * , check_types : Union [bool , str ] = CHECK_TYPES ,
340340 config : Configuration = PythonConfiguration (),
341- init = True , repr = True , eq = True , order = False , unsafe_hash = False , frozen = True , slots = False ) -> Any :
341+ init = True , repr = True , eq = True , order = False ,
342+ unsafe_hash = False , frozen = True , slots = False ) -> Any :
342343 """Runtype's dataclass is a drop-in replacement to Python's built-in dataclass, with added functionality.
343344
344345 **Differences from builtin dataclass:**
@@ -352,7 +353,8 @@ def dataclass(cls=None, *, check_types: Union[bool, str] = CHECK_TYPES,
352353 - Adds convenience methods: replace(), aslist(), astuple(), and iterator for dict(this).
353354 These methods won't override existing ones. They will be added only if the names aren't used.
354355 - Setting the default as ``None`` automatically makes the type into ``Optional``, if it isn't already.
355- - Members without a default are allowed after members with a default (but they are required to create the instance)
356+ - Members without a default are allowed after members with a default
357+ (but they are required in order to create the instance)
356358
357359 3. Misc
358360 - Frozen by default
@@ -387,7 +389,8 @@ def dataclass(cls=None, *, check_types: Union[bool, str] = CHECK_TYPES,
387389 context_frame = inspect .currentframe ().f_back # Get parent frame, to resolve forward-references
388390 def wrap (cls ):
389391 return _process_class (cls , config , check_types , context_frame ,
390- init = init , repr = repr , eq = eq , order = order , unsafe_hash = unsafe_hash , frozen = frozen , slots = slots )
392+ init = init , repr = repr , eq = eq , order = order ,
393+ unsafe_hash = unsafe_hash , frozen = frozen , slots = slots )
391394
392395 # See if we're being called as @dataclass or @dataclass().
393396 if cls is None :
0 commit comments