Skip to content

Commit

Permalink
TYP: Use collections.abc.Buffer in the Array API
Browse files Browse the repository at this point in the history
  • Loading branch information
BvB93 authored and charris committed Sep 14, 2023
1 parent 5ef53c6 commit 56e580d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion numpy/array_api/_typing.py
Expand Up @@ -17,6 +17,8 @@
"PyCapsule",
]

import sys

from typing import (
Any,
Literal,
Expand Down Expand Up @@ -63,8 +65,11 @@ def __len__(self, /) -> int: ...
float64,
]]

if sys.version_info >= (3, 12):
from collections.abc import Buffer as SupportsBufferProtocol
else:
SupportsBufferProtocol = Any

SupportsBufferProtocol = Any
PyCapsule = Any

class SupportsDLPack(Protocol):
Expand Down

0 comments on commit 56e580d

Please sign in to comment.