Skip to content

Commit

Permalink
use list instead of List
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Jun 14, 2024
1 parent 843c1c0 commit d6d61c7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion templates/python-sdrdm-macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Union[
#}
{%- macro get_type(attr) -%}
{%- if attr.multiple is true -%}
List[{{ type(attr, true) }}]
list[{{ type(attr, true) }}]
{%- else -%}
{{ type(attr) }}
{%- endif -%}
Expand Down
2 changes: 1 addition & 1 deletion tests/data/expected_python_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Test:

def add_to_test2(
self,
names: List[str]= [],
names: list[str]= [],
number: Optional[float]= None,
**kwargs,
):
Expand Down
6 changes: 3 additions & 3 deletions tests/data/expected_python_sdrdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Test(
json_schema_extra=dict(term = "schema:one",)
)

test2: List[Test2] = element(
test2: list[Test2] = element(
default_factory=ListPlus,
tag="SomeTest2",
json_schema_extra=dict(term = "schema:something",)
Expand All @@ -46,7 +46,7 @@ class Test(

def add_to_test2(
self,
names: List[str]= [],
names: list[str]= [],
number: Optional[float]= None,
**kwargs,
):
Expand All @@ -66,7 +66,7 @@ class Test2(
sdRDM.DataModel,
search_mode="unordered",
):
names: List[str] = element(
names: list[str] = element(
default_factory=ListPlus,
tag="name",
json_schema_extra=dict(term = "schema:hello",)
Expand Down

0 comments on commit d6d61c7

Please sign in to comment.