Skip to content

Commit d76a049

Browse files
chore: make all classes non generic to closer match runtime behavior
1 parent 69ddfeb commit d76a049

File tree

2 files changed

+91
-117
lines changed

2 files changed

+91
-117
lines changed

capnp/_internal.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ These are imported by lib/capnp.pyi for type annotations but NOT re-exported.
1111
from __future__ import annotations
1212

1313
import asyncio
14-
from typing import Any, Protocol, TypeVar
14+
from typing import Any, Literal, Protocol, TypeVar
15+
1516
from capnp.lib.capnp import _SchemaType
1617

1718
# TypeVars used throughout the stubs
@@ -49,6 +50,7 @@ class SchemaNode(Protocol):
4950
interface: Any
5051
const: Any
5152
annotation: Any
53+
def which(self) -> Literal["interface", "struct"]: ...
5254

5355
class CapnpTypesModule:
5456
Void: _SchemaType

0 commit comments

Comments
 (0)