Skip to content

Commit 2c79d47

Browse files
authored
[cffi] Fix FFI.new's init arg is now Any. (#15683)
1 parent f91c163 commit 2c79d47

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

stubs/cffi/cffi/api.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ class FFI:
3636
def sizeof(self, cdecl: str | CData) -> int: ...
3737
def alignof(self, cdecl: str | CData) -> int: ...
3838
def offsetof(self, cdecl: str | CData, *fields_or_indexes: str | int) -> int: ...
39-
def new(self, cdecl: str | CType, init=None) -> CData: ...
39+
40+
# The acceptable types of `init` depend on the value of `cdecl` only known at runtime, and
41+
# therefore unknown to the type checker.
42+
def new(self, cdecl: str | CType, init: Any = None) -> CData: ...
4043
def new_allocator(
4144
self,
4245
alloc: Callable[[int], CData] | None = None,

0 commit comments

Comments
 (0)