File tree 1 file changed +4
-5
lines changed 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -356,8 +356,8 @@ PEP 681: Data Class Transforms
356
356
:data: `~typing.dataclass_transform ` may be used to
357
357
decorate a class, metaclass, or a function that is itself a decorator.
358
358
The presence of ``@dataclass_transform() `` tells a static type checker that the
359
- decorated object performs runtime "magic" that
360
- transforms a class, giving it :func: `dataclasses.dataclass `-like behaviors.
359
+ decorated object performs runtime "magic" that transforms a class,
360
+ giving it :func: `dataclass < dataclasses.dataclass> `-like behaviors.
361
361
362
362
For example::
363
363
@@ -369,14 +369,13 @@ For example::
369
369
cls.__ne__ = ...
370
370
return cls
371
371
372
- # The create_model decorator can now be used to create new model
373
- # classes, like this:
372
+ # The create_model decorator can now be used to create new model classes:
374
373
@create_model
375
374
class CustomerModel:
376
375
id: int
377
376
name: str
378
377
379
- c = CustomerModel(id=327, name="John Smith ")
378
+ c = CustomerModel(id=327, name="Eric Idle ")
380
379
381
380
See :pep: `681 ` for more details.
382
381
You can’t perform that action at this time.
0 commit comments