Skip to content

Commit

Permalink
Let's not stick in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 5, 2024
1 parent 1d72dcc commit 5fd0f5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/why.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Finally, here's a much more complex example, involving _attrs_ classes where _ca

```python
>>> from enum import unique, Enum
>>> from typing import Optional, Sequence, Union
>>> from typing import Sequence
>>> from cattrs import structure, unstructure
>>> from attrs import define, field

Expand Down Expand Up @@ -79,7 +79,7 @@ Finally, here's a much more complex example, involving _attrs_ classes where _ca

>>> p
[{'cuteness': 1, 'chip': {'chip_id': 1, 'time_chipped': 10.0}}, {'breed': 'maine_coon', 'names': ['Fluffly', 'Fluffer']}]
>>> structure(p, list[Union[Dog, Cat]])
>>> structure(p, list[Dog | Cat])
[Dog(cuteness=1, chip=DogMicrochip(chip_id=1, time_chipped=10.0)), Cat(breed=<CatBreed.MAINE_COON: 'maine_coon'>, names=['Fluffly', 'Fluffer'])]

```
Expand Down

0 comments on commit 5fd0f5b

Please sign in to comment.