Skip to content

Commit 7ed2c31

Browse files
committed
Updated test resources
1 parent 9ec2022 commit 7ed2c31

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

tests/resources_annotated.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import uuid
33
from datetime import datetime
44
from functools import cached_property
5-
from typing import List, Optional
5+
from typing import List, Optional, Annotated
66

77
import odin
88
from odin.annotated_resource import Options
@@ -43,25 +43,25 @@ class Meta:
4343
max_length=32,
4444
)
4545
num_pages: Optional[int]
46-
rrp: float = odin.Options(
47-
20.4,
48-
use_default_if_not_provided=True,
49-
)
46+
rrp: Annotated[float, Options(use_default_if_not_provided=True)] = 20.4
5047
fiction: bool = True
51-
genre: str = Options(
52-
choices=(
53-
("sci-fi", "Science Fiction"),
54-
("fantasy", "Fantasy"),
55-
("biography", "Biography"),
56-
("others", "Others"),
57-
("computers-and-tech", "Computers & technology"),
48+
genre: Annotated[
49+
str,
50+
Options(
51+
choices=(
52+
("sci-fi", "Science Fiction"),
53+
("fantasy", "Fantasy"),
54+
("biography", "Biography"),
55+
("others", "Others"),
56+
("computers-and-tech", "Computers & technology"),
57+
),
5858
),
59-
)
60-
published: List[datetime]
59+
]
60+
published: list[datetime]
6161
authors: List[Author] = odin.Options(
6262
use_container=True,
6363
)
64-
publisher: Optional[Publisher]
64+
publisher: None | Publisher
6565

6666
A_CONST = "Foo Bar"
6767

0 commit comments

Comments
 (0)