Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion stubs/PyYAML/yaml/_yaml.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
from _typeshed import Incomplete, SupportsRead
from collections.abc import Mapping, Sequence
from typing import IO, Any
from typing_extensions import disjoint_base

from .events import Event
from .nodes import Node
from .tokens import Token

def get_version_string() -> str: ...
def get_version() -> tuple[int, int, int]: ...

@disjoint_base
class Mark:
name: Any
index: int
Expand All @@ -19,6 +20,7 @@ class Mark:
def __init__(self, name, index: int, line: int, column: int, buffer, pointer) -> None: ...
def get_snippet(self): ...

@disjoint_base
class CParser:
def __init__(self, stream: str | bytes | SupportsRead[str | bytes]) -> None: ...
def dispose(self) -> None: ...
Expand All @@ -34,6 +36,7 @@ class CParser:
def raw_parse(self) -> int: ...
def raw_scan(self) -> int: ...

@disjoint_base
class CEmitter:
def __init__(
self,
Expand Down
3 changes: 2 additions & 1 deletion stubs/cffi/_cffi_backend.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import types
from _typeshed import Incomplete, ReadableBuffer, WriteableBuffer
from collections.abc import Callable, Hashable
from typing import Any, ClassVar, Literal, Protocol, SupportsIndex, TypeVar, final, overload, type_check_only
from typing_extensions import Self, TypeAlias
from typing_extensions import Self, TypeAlias, disjoint_base

_T = TypeVar("_T")

Expand Down Expand Up @@ -111,6 +111,7 @@ class buffer:
_tmp_CType = CType
_tmp_buffer = buffer

@disjoint_base
class FFI:
CData: TypeAlias = _CDataBase
CType: TypeAlias = _tmp_CType
Expand Down
10 changes: 9 additions & 1 deletion stubs/gdb/gdb/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import threading
from collections.abc import Callable, Iterator, Mapping, Sequence
from contextlib import AbstractContextManager
from typing import Any, Final, Generic, Literal, Protocol, TypedDict, TypeVar, final, overload, type_check_only
from typing_extensions import TypeAlias, deprecated
from typing_extensions import TypeAlias, deprecated, disjoint_base

import gdb.FrameDecorator
import gdb.types
Expand Down Expand Up @@ -74,6 +74,7 @@ class GdbError(Exception): ...
_ValueOrNative: TypeAlias = bool | int | float | str | Value | LazyString
_ValueOrInt: TypeAlias = Value | int

@disjoint_base
class Value:
address: Value
is_optimized_out: bool
Expand Down Expand Up @@ -406,6 +407,7 @@ class RecordFunctionSegment:

# CLI Commands

@disjoint_base
class Command:
def __init__(self, name: str, command_class: int, completer_class: int = ..., prefix: bool = ...) -> None: ...
def dont_repeat(self) -> None: ...
Expand Down Expand Up @@ -437,6 +439,7 @@ COMPLETE_EXPRESSION: int

# GDB/MI Commands

@disjoint_base
class MICommand:
name: str
installed: bool
Expand All @@ -446,6 +449,7 @@ class MICommand:

# Parameters

@disjoint_base
class Parameter:
set_doc: str
show_doc: str
Expand Down Expand Up @@ -682,6 +686,7 @@ class LineTable:

# Breakpoints

@disjoint_base
class Breakpoint:
# The where="spec" form of __init__(). See py-breakpoints.c:bppy_init():keywords for the positional order.
@overload
Expand Down Expand Up @@ -854,6 +859,7 @@ WP_ACCESS: int

# Finish Breakpoints

@disjoint_base
class FinishBreakpoint(Breakpoint):
return_value: Value | None

Expand Down Expand Up @@ -907,6 +913,7 @@ class RegisterGroupsIterator(Iterator[RegisterGroup]):

# Connections

@disjoint_base
class TargetConnection:
def is_valid(self) -> bool: ...

Expand Down Expand Up @@ -941,6 +948,7 @@ class _Window(Protocol):
def click(self, x: int, y: int, button: int) -> None: ...

# Events
@disjoint_base
class Event: ...

class ThreadEvent(Event):
Expand Down
2 changes: 2 additions & 0 deletions stubs/gdb/gdb/disassembler.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from collections.abc import Sequence
from typing import Final, final
from typing_extensions import disjoint_base

import gdb
from gdb import Architecture, Progspace
Expand All @@ -8,6 +9,7 @@ class Disassembler:
def __init__(self, name: str) -> None: ...
def __call__(self, info): ...

@disjoint_base
class DisassembleInfo:
address: int
architecture: Architecture
Expand Down
4 changes: 4 additions & 0 deletions stubs/gevent/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ gevent.socket.SocketType.makefile
gevent.socket.SocketType.sendfile
gevent.socket.SocketType.set_inheritable

# Pretends to re-export a type marked @disjoint_base in the stubs, but runtime
# defines __slots__
gevent.socket.SocketType$

# zope.interface related attributes we can ignore
gevent.[\w\.]+\.__implemented__
gevent.[\w\.]+\.__providedBy__
Expand Down
2 changes: 2 additions & 0 deletions stubs/gevent/gevent/_greenlet_primitives.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from abc import abstractmethod
from typing import Any, NoReturn
from typing_extensions import disjoint_base

from gevent._types import _Loop
from greenlet import greenlet

class TrackedRawGreenlet(greenlet): ...

@disjoint_base
class SwitchOutGreenletWithLoop(TrackedRawGreenlet):
@property
@abstractmethod
Expand Down
3 changes: 2 additions & 1 deletion stubs/gevent/gevent/_hub_primitives.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ from _typeshed import FileDescriptor
from collections.abc import Callable, Collection, Iterable
from types import TracebackType
from typing import Any, Generic, Protocol, TypeVar, overload, type_check_only
from typing_extensions import Self, TypeVarTuple, Unpack
from typing_extensions import Self, TypeVarTuple, Unpack, disjoint_base

from gevent._greenlet_primitives import SwitchOutGreenletWithLoop
from gevent._types import _Loop, _Watcher
Expand Down Expand Up @@ -32,6 +32,7 @@ class WaitOperationsGreenlet(SwitchOutGreenletWithLoop):
) -> None: ...
def cancel_wait(self, watcher: _Watcher, error: type[BaseException] | BaseException, close_watcher: bool = False) -> None: ...

@disjoint_base
class _WaitIterator(Generic[_T]):
def __init__(self, objects: Collection[_T], hub: Hub, timeout: float, count: None | int) -> None: ...
def __enter__(self) -> Self: ...
Expand Down
4 changes: 3 additions & 1 deletion stubs/gevent/gevent/_imap.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable, Iterable
from typing import Any, TypeVar
from typing_extensions import ParamSpec, Self
from typing_extensions import ParamSpec, Self, disjoint_base

from gevent.greenlet import Greenlet
from gevent.queue import UnboundQueue
Expand All @@ -12,6 +12,7 @@ _P = ParamSpec("_P")
# returned by some public API functions, we don't bother adding a whole bunch of overloads to handle
# the case of 1-n Iterables being passed in and just go for the fully unsafe signature
# we do the crazy overloads instead in the functions that create these objects
@disjoint_base
class IMapUnordered(Greenlet[_P, _T]):
finished: bool
# it may contain an undocumented Failure object
Expand All @@ -20,6 +21,7 @@ class IMapUnordered(Greenlet[_P, _T]):
def __iter__(self) -> Self: ...
def __next__(self) -> _T: ...

@disjoint_base
class IMap(IMapUnordered[_P, _T]):
index: int

Expand Down
3 changes: 2 additions & 1 deletion stubs/gevent/gevent/greenlet.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import weakref
from collections.abc import Callable, Iterable, Sequence
from types import FrameType, TracebackType
from typing import Any, ClassVar, Generic, TypeVar, overload
from typing_extensions import ParamSpec, Self
from typing_extensions import ParamSpec, Self, disjoint_base

import greenlet
from gevent._types import _Loop
Expand All @@ -12,6 +12,7 @@ _T = TypeVar("_T")
_G = TypeVar("_G", bound=greenlet.greenlet)
_P = ParamSpec("_P")

@disjoint_base
class Greenlet(greenlet.greenlet, Generic[_P, _T]):
# we can't use _P.args/_P.kwargs here because pyright will complain
# mypy doesn't seem to mind though
Expand Down
4 changes: 2 additions & 2 deletions stubs/gevent/gevent/libev/corecext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from _typeshed import FileDescriptor
from collections.abc import Callable, Sequence
from types import TracebackType
from typing import Any
from typing_extensions import ParamSpec
from typing_extensions import ParamSpec, disjoint_base

from gevent._ffi.loop import _ErrorHandler
from gevent._types import _Callback
Expand All @@ -20,7 +20,7 @@ if sys.platform != "win32":
def recommended_backends() -> list[str | int]: ...
def supported_backends() -> list[str | int]: ...
def time() -> float: ...

@disjoint_base
class loop:
starting_timer_may_update_loop_time: bool
error_handler: _ErrorHandler
Expand Down
4 changes: 3 additions & 1 deletion stubs/gevent/gevent/resolver/cares.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections.abc import Callable, Iterable, Sequence
from typing import Any, Generic, TypeVar
from typing_extensions import Self
from typing_extensions import Self, disjoint_base

from gevent._types import _AddrinfoResult, _Loop, _NameinfoResult, _SockAddr

Expand All @@ -10,13 +10,15 @@ class ares_host_result(tuple[str, list[str], list[str]]):
family: int
def __new__(cls, family: int, iterable: Iterable[Any]) -> Self: ...

@disjoint_base
class Result(Generic[_T]):
exception: BaseException | None
value: _T | None
def __init__(self, value: _T | None = None, exception: BaseException | None = None) -> None: ...
def get(self) -> Any | None: ...
def successful(self) -> bool: ...

@disjoint_base
class channel:
@property
def loop(self) -> _Loop: ...
Expand Down
3 changes: 2 additions & 1 deletion stubs/greenlet/greenlet/_greenlet.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ from collections.abc import Callable
from contextvars import Context
from types import FrameType, TracebackType
from typing import Any, Literal, Protocol, overload, type_check_only
from typing_extensions import TypeAlias
from typing_extensions import TypeAlias, disjoint_base

_TraceEvent: TypeAlias = Literal["switch", "throw"]
_TraceCallback: TypeAlias = Callable[[_TraceEvent, tuple[greenlet, greenlet]], object]
Expand All @@ -27,6 +27,7 @@ class _ParentDescriptor(Protocol):
class GreenletExit(BaseException): ...
class error(Exception): ...

@disjoint_base
class greenlet:
@property
def dead(self) -> bool: ...
Expand Down
5 changes: 4 additions & 1 deletion stubs/hdbcli/hdbcli/dbapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ from collections.abc import Callable, Sequence
from datetime import date, datetime, time
from types import TracebackType
from typing import Any, Final, Literal, overload
from typing_extensions import Self, TypeAlias
from typing_extensions import Self, TypeAlias, disjoint_base

from .resultrow import ResultRow

apilevel: Final[str]
threadsafety: Final[int]
paramstyle: Final[tuple[str, ...]] # hdbcli defines it as a tuple which does not follow PEP 249

@disjoint_base
class Connection:
def __init__(
self,
Expand Down Expand Up @@ -42,6 +43,7 @@ class Connection:

connect = Connection

@disjoint_base
class LOB:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
def close(self) -> bool: ...
Expand All @@ -52,6 +54,7 @@ class LOB:
_Parameters: TypeAlias = Sequence[tuple[Any, ...]] | None
_Holdability: TypeAlias = Literal[0, 1, 2, 3]

@disjoint_base
class Cursor:
description: tuple[tuple[Any, ...], ...]
rowcount: int
Expand Down
2 changes: 2 additions & 0 deletions stubs/hdbcli/hdbcli/resultrow.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from collections.abc import Iterator, Sequence
from typing import Any, overload
from typing_extensions import disjoint_base

@disjoint_base
class ResultRow:
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
column_names: tuple[str, ...]
Expand Down
4 changes: 3 additions & 1 deletion stubs/lupa/lupa/lua51.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import Self, TypeAlias
from typing_extensions import Self, TypeAlias, disjoint_base

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -62,6 +62,7 @@ class _LuaNoGC: ...

_bint = TypeVar("_bint", bool, int)

@disjoint_base
class FastRLock(Generic[_bint]):
# @classmethod
# def __init__(cls, /, *args: Any, **kwargs: Any) -> None: ...
Expand All @@ -74,6 +75,7 @@ class LuaError(Exception): ...
class LuaSyntaxError(LuaError): ...
class LuaMemoryError(LuaError, MemoryError): ...

@disjoint_base
class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]
Expand Down
4 changes: 3 additions & 1 deletion stubs/lupa/lupa/lua52.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import Self, TypeAlias
from typing_extensions import Self, TypeAlias, disjoint_base

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -62,6 +62,7 @@ class _LuaNoGC: ...

_bint = TypeVar("_bint", bool, int)

@disjoint_base
class FastRLock(Generic[_bint]):
# @classmethod
# def __init__(cls, /, *args: Any, **kwargs: Any) -> None: ...
Expand All @@ -74,6 +75,7 @@ class LuaError(Exception): ...
class LuaSyntaxError(LuaError): ...
class LuaMemoryError(LuaError, MemoryError): ...

@disjoint_base
class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]
Expand Down
4 changes: 3 additions & 1 deletion stubs/lupa/lupa/lua53.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from _typeshed import MaybeNone
from collections.abc import Callable, Iterable
from typing import Any, Final, Generic, TypeVar, type_check_only
from typing_extensions import Self, TypeAlias
from typing_extensions import Self, TypeAlias, disjoint_base

__all__ = [
"LUA_VERSION",
Expand Down Expand Up @@ -62,6 +62,7 @@ class _LuaNoGC: ...

_bint = TypeVar("_bint", bool, int)

@disjoint_base
class FastRLock(Generic[_bint]):
# @classmethod
# def __init__(cls, /, *args: Any, **kwargs: Any) -> None: ...
Expand All @@ -74,6 +75,7 @@ class LuaError(Exception): ...
class LuaSyntaxError(LuaError): ...
class LuaMemoryError(LuaError, MemoryError): ...

@disjoint_base
class LuaRuntime:
lua_implementation: Final[str]
lua_version: Final[tuple[int, int]]
Expand Down
Loading
Loading