Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatal1ty committed Jan 6, 2024
1 parent 4e38d01 commit b7eea14
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1829,12 +1829,13 @@ python -m timeit -s "from typing import NewType; MyInt = NewType('MyInt', int)"
50000000 loops, best of 5: 4.35 nsec per loop
```

However, when you create dataclass instances using the `from_*` method, there
will be no performance degradation, because the value won't be enclosed in the
callable in the generated code. Therefore, if performance is more important
to you than catching logical errors by type checkers, and you are actively
creating or changing dataclasses manually, then you should take a closer look
at using `Annotated`.
However, when you create dataclass instances using the `from_*` method provided
by one of the mixins or using one of the decoders, there will be no performance
degradation, because the value won't be enclosed in the callable in the
generated code. Therefore, if performance is more important to you than
catching logical errors by type checkers, and you are actively creating or
changing dataclasses manually, then you should take a closer look at using
`Annotated`.

### Dialects

Expand Down

0 comments on commit b7eea14

Please sign in to comment.