Use PEP 570 syntax in third party stubs (#11554)

This commit is contained in:
Shantanu
2024-03-10 06:11:43 -07:00
committed by GitHub
parent f94bbfbcc4
commit 88fa182253
97 changed files with 625 additions and 632 deletions
+6 -6
View File
@@ -47,10 +47,10 @@ class greenlet:
def switch(self, *args: Any, **kwargs: Any) -> Any: ...
@overload
def throw(
self, __typ: type[BaseException] = ..., __val: BaseException | object = None, __tb: TracebackType | None = None
self, typ: type[BaseException] = ..., val: BaseException | object = None, tb: TracebackType | None = None, /
) -> Any: ...
@overload
def throw(self, __typ: BaseException = ..., __val: None = None, __tb: TracebackType | None = None) -> Any: ...
def throw(self, typ: BaseException = ..., val: None = None, tb: TracebackType | None = None, /) -> Any: ...
def __bool__(self) -> bool: ...
# aliases for some module attributes/methods
@@ -61,18 +61,18 @@ class greenlet:
@staticmethod
def gettrace() -> _TraceCallback | None: ...
@staticmethod
def settrace(__callback: _TraceCallback | None) -> _TraceCallback | None: ...
def settrace(callback: _TraceCallback | None, /) -> _TraceCallback | None: ...
class UnswitchableGreenlet(greenlet): # undocumented
force_switch_error: bool
force_slp_switch_error: bool
def enable_optional_cleanup(__enabled: bool) -> None: ...
def enable_optional_cleanup(enabled: bool, /) -> None: ...
def get_clocks_used_doing_optional_cleanup() -> int: ...
def get_pending_cleanup_count() -> int: ...
def get_total_main_greenlets() -> int: ...
def get_tstate_trash_delete_nesting() -> int: ...
def getcurrent() -> greenlet: ...
def gettrace() -> _TraceCallback | None: ...
def set_thread_local(__key: object, __value: object) -> None: ...
def settrace(__callback: _TraceCallback | None) -> _TraceCallback | None: ...
def set_thread_local(key: object, value: object, /) -> None: ...
def settrace(callback: _TraceCallback | None, /) -> _TraceCallback | None: ...