Skip to content

Commit 9dd48ae

Browse files
authored
Fix some of the typing for CFFI's out of line mode (#14090)
1 parent a545707 commit 9dd48ae

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

stubs/cffi/_cffi_backend.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class FFI:
127127

128128
def __init__(
129129
self,
130-
module_name: bytes = ...,
130+
module_name: str = ...,
131131
_version: int = ...,
132132
_types: bytes = ...,
133133
_globals: tuple[bytes | int, ...] = ...,
@@ -157,7 +157,7 @@ class FFI:
157157
error: Any = ...,
158158
onerror: Callable[[Exception, Any, Any], None] | None = ...,
159159
) -> Callable[..., _T]: ...
160-
def cast(self, cdecl: str | CType, value: CData) -> CData: ...
160+
def cast(self, cdecl: str | CType, value: CData | int) -> CData: ...
161161
def def_extern(
162162
self, name: str = ..., error: Any = ..., onerror: Callable[[Exception, Any, types.TracebackType], Any] = ...
163163
) -> Callable[[Callable[..., _T]], Callable[..., _T]]: ...

stubs/cffi/cffi/api.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class FFI:
8989
def from_handle(self, x: CData) -> Any: ...
9090
def release(self, x: CData) -> None: ...
9191
def set_unicode(self, enabled_flag: bool) -> None: ...
92-
def set_source(self, module_name: str, source: str, source_extension: str = ".c", **kwds: Any) -> None: ...
92+
def set_source(self, module_name: str, source: str | None, source_extension: str = ".c", **kwds: Any) -> None: ...
9393
def set_source_pkgconfig(
9494
self, module_name: str, pkgconfig_libs: list[str], source: str, source_extension: str = ".c", **kwds: Any
9595
) -> None: ...

0 commit comments

Comments
 (0)