Skip to content

Commit 9f189c6

Browse files
committed
ENH: Drop typing.Type for type
1 parent 45cdb1c commit 9f189c6

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

nibabel/analyze.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@
8383
"""
8484
from __future__ import annotations
8585

86-
from typing import Type
87-
8886
import numpy as np
8987

9088
from .arrayproxy import ArrayProxy
@@ -895,7 +893,7 @@ def may_contain_header(klass, binaryblock):
895893
class AnalyzeImage(SpatialImage):
896894
"""Class for basic Analyze format image"""
897895

898-
header_class: Type[AnalyzeHeader] = AnalyzeHeader
896+
header_class: type[AnalyzeHeader] = AnalyzeHeader
899897
header: AnalyzeHeader
900898
_meta_sniff_len = header_class.sizeof_hdr
901899
files_types: tuple[tuple[str, str], ...] = (('image', '.img'), ('header', '.hdr'))

nibabel/filebasedimages.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import io
1313
import typing as ty
1414
from copy import deepcopy
15-
from typing import Type
1615
from urllib import request
1716

1817
from ._compression import COMPRESSION_ERRORS
@@ -158,7 +157,7 @@ class FileBasedImage:
158157
work.
159158
"""
160159

161-
header_class: Type[FileBasedHeader] = FileBasedHeader
160+
header_class: type[FileBasedHeader] = FileBasedHeader
162161
_meta_sniff_len: int = 0
163162
files_types: tuple[ExtensionSpec, ...] = (('image', None),)
164163
valid_exts: tuple[str, ...] = ()

nibabel/minc1.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from __future__ import annotations
1111

1212
from numbers import Integral
13-
from typing import Type
1413

1514
import numpy as np
1615

@@ -307,7 +306,7 @@ class Minc1Image(SpatialImage):
307306
load.
308307
"""
309308

310-
header_class: Type[MincHeader] = Minc1Header
309+
header_class: type[MincHeader] = Minc1Header
311310
header: MincHeader
312311
_meta_sniff_len: int = 4
313312
valid_exts: tuple[str, ...] = ('.mnc',)

nibabel/nifti1.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import warnings
1616
from io import BytesIO
17-
from typing import Type
1817

1918
import numpy as np
2019
import numpy.linalg as npl
@@ -90,8 +89,8 @@
9089
# datatypes not in analyze format, with codes
9190
if have_binary128():
9291
# Only enable 128 bit floats if we really have IEEE binary 128 longdoubles
93-
_float128t: Type[np.generic] = np.longdouble
94-
_complex256t: Type[np.generic] = np.longcomplex
92+
_float128t: type[np.generic] = np.longdouble
93+
_complex256t: type[np.generic] = np.longcomplex
9594
else:
9695
_float128t = np.void
9796
_complex256t = np.void

0 commit comments

Comments
 (0)