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
2 changes: 1 addition & 1 deletion stubs/boltons/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "25.0.*"
version = "26.1.*"
upstream-repository = "https://github.com/mahmoud/boltons"
3 changes: 3 additions & 0 deletions stubs/boltons/boltons/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Final

__version__: Final[str]
1 change: 1 addition & 0 deletions stubs/boltons/boltons/dictutils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _VT = TypeVar("_VT")
_T = TypeVar("_T")

class OrderedMultiDict(dict[_KT, _VT]):
def __reduce__(self) -> tuple[type[Self], tuple[()], list[tuple[_KT, _VT]]]: ...
def add(self, k: _KT, v: _VT) -> None: ...
def addlist(self, k: _KT, v: Iterable[_VT]) -> None: ...
def clear(self) -> None: ...
Expand Down
9 changes: 7 additions & 2 deletions stubs/boltons/boltons/funcutils.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import functools
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Callable
from functools import total_ordering as total_ordering
from typing import TypeVar

_R = TypeVar("_R")

NO_DEFAULT: Incomplete

Expand Down Expand Up @@ -60,4 +64,5 @@ class FunctionBuilder:
class MissingArgument(ValueError): ...
class ExistingArgument(ValueError): ...

def noop(*args, **kwargs) -> None: ...
def noop(*args: Unused, **kwargs: Unused) -> None: ...
def once(func: Callable[[], _R]) -> Callable[[], _R]: ...
22 changes: 13 additions & 9 deletions stubs/boltons/boltons/iterutils.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
from _typeshed import Incomplete
from collections.abc import Generator
from collections.abc import Callable, Generator, Iterable
from typing import TypeVar
from typing_extensions import TypeIs

def is_iterable(obj) -> bool: ...
def is_scalar(obj) -> bool: ...
def is_collection(obj) -> bool: ...
_T = TypeVar("_T")

def is_iterable(obj: Iterable[_T] | object) -> TypeIs[Iterable[_T]]: ...
def is_scalar(obj: object) -> bool: ...
def is_collection(obj: object) -> bool: ...
def split(src, sep=None, maxsplit=None): ...
def split_iter(src, sep=None, maxsplit=None) -> Generator[Incomplete, None, Incomplete]: ...
def split_iter(src, sep=None, maxsplit=None) -> Generator[list[Incomplete]]: ...
def lstrip(iterable, strip_value=None): ...
def lstrip_iter(iterable, strip_value=None) -> Generator[Incomplete]: ...
def rstrip(iterable, strip_value=None): ...
def rstrip_iter(iterable, strip_value=None) -> Generator[Incomplete]: ...
def strip(iterable, strip_value=None): ...
def strip_iter(iterable, strip_value=None): ...
def chunked(src, size, count=None, **kw): ...
def chunked_iter(src, size, **kw) -> Generator[Incomplete, None, Incomplete]: ...
def chunked_iter(src, size, **kw) -> Generator[str | bytes]: ...
def chunk_ranges(
input_size: int, chunk_size: int, input_offset: int = 0, overlap_size: int = 0, align: bool = False
) -> Generator[tuple[int, int]]: ...
Expand All @@ -26,9 +30,9 @@ def frange(stop, start=None, step: float = 1.0): ...
def backoff(start, stop, count=None, factor: float = 2.0, jitter: bool = False): ...
def backoff_iter(start, stop, count=None, factor: float = 2.0, jitter: bool = False) -> Generator[Incomplete]: ...
def bucketize(src, key=..., value_transform=None, key_filter=None): ...
def partition(src, key=...): ...
def partition(src, key=..., *keys: str | Callable[..., Incomplete]) -> tuple[list[Incomplete], ...]: ...
def unique(src, key=None): ...
def unique_iter(src, key=None) -> Generator[Incomplete, None, Incomplete]: ...
def unique_iter(src, key=None) -> Generator[Incomplete]: ...
def redundant(src, key=None, groups: bool = False): ...
def one(src, default=None, key=None): ...
def first(iterable, default=None, key=None): ...
Expand All @@ -38,7 +42,7 @@ def same(iterable, ref=...): ...
def default_visit(path, key, value): ...
def default_enter(path, key, value): ...
def default_exit(path, key, old_parent, new_parent, new_items): ...
def remap(root, visit=..., enter=..., exit=..., **kwargs): ...
def remap(root, visit=..., enter=..., exit=..., cache: bool = True, **kwargs): ...

class PathAccessError(KeyError, IndexError, TypeError):
exc: Incomplete
Expand Down
6 changes: 3 additions & 3 deletions stubs/boltons/boltons/strutils.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from _typeshed import ReadableBuffer
from collections.abc import Callable, Generator, Iterable, Sized
from collections.abc import Callable, Generator, Iterable, Sequence, Sized
from html.parser import HTMLParser
from re import Pattern
from typing import Literal, overload
Expand Down Expand Up @@ -32,8 +32,6 @@ class DeaccenterDict(dict[int, int]):
def bytes2human(nbytes: int, ndigits: int = 0) -> str: ...

class HTMLTextExtractor(HTMLParser):
strict: bool
convert_charrefs: bool
result: list[str]
def __init__(self) -> None: ...
def handle_data(self, d: str) -> None: ...
Expand Down Expand Up @@ -66,6 +64,7 @@ class MultiReplace:
def multi_replace(text: str, sub_map: dict[str, str], **kwargs) -> str: ...
def unwrap_text(text: str, ending: str | None = "\n\n") -> str: ...
def removeprefix(text: str, prefix: str) -> str: ...
def human_readable_list(items: Sequence[str], delimiter: str = ",", conjunction: str = "and", *, oxford: bool = True) -> str: ...

__all__ = [
"camel2under",
Expand Down Expand Up @@ -100,4 +99,5 @@ __all__ = [
"multi_replace",
"unwrap_text",
"removeprefix",
"human_readable_list",
]