diff --git a/templates/python-sdrdm-macros.jinja b/templates/python-sdrdm-macros.jinja index 3f74e6d..fba6db3 100644 --- a/templates/python-sdrdm-macros.jinja +++ b/templates/python-sdrdm-macros.jinja @@ -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 -%} diff --git a/tests/data/expected_python_dc.py b/tests/data/expected_python_dc.py index 78187a5..d4d6d8a 100644 --- a/tests/data/expected_python_dc.py +++ b/tests/data/expected_python_dc.py @@ -45,7 +45,7 @@ class Test: def add_to_test2( self, - names: List[str]= [], + names: list[str]= [], number: Optional[float]= None, **kwargs, ): diff --git a/tests/data/expected_python_sdrdm.py b/tests/data/expected_python_sdrdm.py index db51ddd..e477c7a 100644 --- a/tests/data/expected_python_sdrdm.py +++ b/tests/data/expected_python_sdrdm.py @@ -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",) @@ -46,7 +46,7 @@ class Test( def add_to_test2( self, - names: List[str]= [], + names: list[str]= [], number: Optional[float]= None, **kwargs, ): @@ -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",)