Skip to content

Commit f8b92fe

Browse files
style: pre-commit fixes
1 parent df7203a commit f8b92fe

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

numcodecs/abc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@
2929
"""
3030

3131
from abc import ABC, abstractmethod
32-
from typing import Optional
3332

3433

3534
class Codec(ABC):
3635
"""Codec abstract base class."""
3736

3837
# override in sub-class
39-
codec_id: Optional[str] = None
38+
codec_id: str | None = None
4039
"""Codec identifier."""
4140

4241
@abstractmethod

numcodecs/checksum32.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import zlib
44
from contextlib import suppress
55
from types import ModuleType
6-
from typing import Literal, Optional
6+
from typing import Literal
77

88
import numpy as np
99
from typing_extensions import Buffer
@@ -12,7 +12,7 @@
1212
from .compat import ensure_contiguous_ndarray, ndarray_copy
1313
from .jenkins import jenkins_lookup3
1414

15-
_crc32c: Optional[ModuleType] = None
15+
_crc32c: ModuleType | None = None
1616
with suppress(ImportError):
1717
import crc32c as _crc32c # type: ignore[no-redef, unused-ignore]
1818

numcodecs/lzma.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from types import ModuleType
2-
from typing import Optional
32

4-
_lzma: Optional[ModuleType] = None
3+
_lzma: ModuleType | None = None
54
try:
65
import lzma as _lzma
76
except ImportError: # pragma: no cover

numcodecs/zfpy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
from contextlib import suppress
33
from importlib.metadata import PackageNotFoundError, version
44
from types import ModuleType
5-
from typing import Optional
65

7-
_zfpy: Optional[ModuleType] = None
6+
_zfpy: ModuleType | None = None
87

98
_zfpy_version: tuple = ()
109
with suppress(PackageNotFoundError):

0 commit comments

Comments
 (0)