mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Python <3.9 typing compat: list
Subscribing builtins.list wasn't added until Python 3.9 so use `typing.List` where applicable.
This commit is contained in:
@@ -82,7 +82,7 @@ typing_imports = """\
|
||||
from __future__ import annotations
|
||||
from collections.abc import Callable
|
||||
from enum import IntEnum, IntFlag, auto
|
||||
from typing import Any, overload, TypeAlias, TypeVar, ParamSpec, Generic, Union, Optional
|
||||
from typing import Any, overload, TypeAlias, TypeVar, ParamSpec, Generic, Union, Optional, List
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@@ -213,11 +213,11 @@ class FixWxPrefix(object):
|
||||
if type_name.startswith('Vector<') and type_name.endswith('>'):
|
||||
# Special handling for 'Vector<type>' types
|
||||
type_name = self.cleanType(type_name[7:-1])
|
||||
return f'list[{type_name}]'
|
||||
return f'List[{type_name}]'
|
||||
if type_name.startswith('Array'):
|
||||
type_name = self.cleanType(type_name[5:])
|
||||
if type_name:
|
||||
return f'list[{type_name}]'
|
||||
return f'List[{type_name}]'
|
||||
else:
|
||||
return 'list'
|
||||
return type_map.get(type_name, type_name)
|
||||
|
||||
Reference in New Issue
Block a user