Skip to content

Commit

Permalink
feat: add DType type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Oct 31, 2023
1 parent b29094f commit 0c082a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/awkward/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
# ruff: noqa: PLE0604
from __future__ import annotations

import numpy
import sys
import typing
from typing import * # noqa: F403

__all__ = list(
{
"ClassVar",
"Final",
"Self",
"final",
Expand All @@ -27,7 +29,7 @@
AxisMaybeNone = TypeVar("AxisMaybeNone", int, None) # noqa: F405

if sys.version_info < (3, 11):
from typing import Final, SupportsIndex, runtime_checkable
from typing import ClassVar, Final, SupportsIndex, runtime_checkable

from typing_extensions import (
Literal,
Expand All @@ -40,6 +42,7 @@
)
else:
from typing import (
ClassVar,
Final,
Literal,
Protocol,
Expand All @@ -57,3 +60,5 @@
"str | int | float | bool | None | list | tuple | JSONMapping"
)
JSONMapping: TypeAlias = "dict[str, JSONSerializable]"

DType = TypeVar("DType", bound=numpy.dtype)

0 comments on commit 0c082a2

Please sign in to comment.