summaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/numpy/typing/tests/data/reveal/shape.pyi
blob: 2406a39f9682b66623bd9879afdfcfe311c5f869 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from typing import Any, NamedTuple, assert_type

import numpy as np

# Subtype of tuple[int, int]
class XYGrid(NamedTuple):
    x_axis: int
    y_axis: int

arr: np.ndarray[XYGrid, Any]

# Test shape property matches shape typevar
assert_type(arr.shape, XYGrid)