Skip to content

Commit 18363fb

Browse files
committed
UP007
1 parent e118075 commit 18363fb

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

localstack-core/localstack/aws/mocking.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,9 @@
3232
"boolean",
3333
}
3434

35-
Instance = Union[
36-
Dict[str, "Instance"],
37-
List["Instance"],
38-
str,
39-
bytes,
40-
map,
41-
list,
42-
float,
43-
int,
44-
bool,
45-
date,
46-
]
35+
Instance = (
36+
dict[str, "Instance"] | list["Instance"] | str | bytes | map | list | float | int | bool | date
37+
)
4738

4839
# https://github.com/boto/botocore/issues/2623
4940
StringShape.METADATA_ATTRS.append("pattern")

localstack-core/localstack/services/apigateway/legacy/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from localstack.utils.strings import short_uid, to_str
1111

1212
# type definition for data parameters (i.e., invocation payloads)
13-
InvocationPayload = Union[Dict, str, bytes]
13+
InvocationPayload = dict | str | bytes
1414

1515

1616
class ApiGatewayVersion(Enum):

localstack-core/localstack/services/cloudformation/engine/transformers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import re
66
from copy import deepcopy
77
from dataclasses import dataclass
8-
from typing import Any, Callable, Dict, Optional, Type, Union
8+
from typing import Any, Callable, Dict, Optional, Type
99

1010
import boto3
1111
from botocore.exceptions import ClientError
@@ -27,7 +27,7 @@
2727
EXTENSIONS_TRANSFORM = "AWS::LanguageExtensions"
2828
SECRETSMANAGER_TRANSFORM = "AWS::SecretsManager-2020-07-23"
2929

30-
TransformResult = Union[dict, str]
30+
TransformResult = dict | str
3131

3232

3333
@dataclass

localstack-core/localstack/services/cloudformation/engine/v2/change_set_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import abc
44
import enum
55
from itertools import zip_longest
6-
from typing import TYPE_CHECKING, Any, Final, Generator, Optional, TypedDict, Union, cast
6+
from typing import TYPE_CHECKING, Any, Final, Generator, Optional, TypedDict, cast
77

88
from typing_extensions import TypeVar
99

@@ -47,7 +47,7 @@ def __contains__(self, item):
4747
return False
4848

4949

50-
Maybe = Union[T, NothingType]
50+
Maybe = T | NothingType
5151
Nothing = NothingType()
5252

5353

0 commit comments

Comments
 (0)