Skip to content

Commit 9aaacfa

Browse files
STY: Applty ruff/pyupgrade rule UP006
UP006 Use `type` instead of `Type` for type annotation UP006 Use `tuple` instead of `ty.Tuple` for type annotation
1 parent 83eaf0b commit 9aaacfa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nibabel/gifti/gifti.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import sys
1919
import warnings
2020
from copy import copy
21-
from typing import Type, cast
21+
from typing import cast
2222

2323
import numpy as np
2424

@@ -598,7 +598,7 @@ class GiftiImage(xml.XmlSerializable, SerializableImage):
598598
# The parser will in due course be a GiftiImageParser, but we can't set
599599
# that now, because it would result in a circular import. We set it after
600600
# the class has been defined, at the end of the class definition.
601-
parser: Type[xml.XmlParser]
601+
parser: type[xml.XmlParser]
602602

603603
def __init__(
604604
self,

nibabel/spatialimages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def set_data_dtype(self, dtype: npt.DTypeLike) -> None: ...
169169
@ty.runtime_checkable
170170
class SpatialProtocol(ty.Protocol):
171171
def get_data_dtype(self) -> np.dtype: ...
172-
def get_data_shape(self) -> ty.Tuple[int, ...]: ...
173-
def get_zooms(self) -> ty.Tuple[float, ...]: ...
172+
def get_data_shape(self) -> tuple[int, ...]: ...
173+
def get_zooms(self) -> tuple[float, ...]: ...
174174

175175

176176
class HeaderDataError(Exception):

0 commit comments

Comments
 (0)