Add __all__ (#13704)

This commit is contained in:
Semyon Moroz
2025-03-25 14:09:32 +01:00
committed by GitHub
parent 4a750cef35
commit 9234985c3d
54 changed files with 311 additions and 63 deletions
@@ -1,19 +1,2 @@
# TODO: missing from stub
boltons.debugutils.__all__
boltons.dictutils.__all__
boltons.excutils.__all__
boltons.fileutils.__all__
boltons.formatutils.__all__
boltons.gcutils.__all__
boltons.jsonutils.__all__
boltons.listutils.__all__
boltons.namedutils.__all__
boltons.pathutils.__all__
boltons.queueutils.__all__
boltons.setutils.__all__
boltons.strutils.__all__
boltons.tableutils.__all__
boltons.tbutils.__all__
boltons.funcutils.CachedInstancePartial.__partialmethod__
boltons.funcutils.InstancePartial.__partialmethod__
+2
View File
@@ -6,3 +6,5 @@ def pdb_on_exception(limit: int = 100) -> None: ...
def wrap_trace(
obj, hook: Callable[..., Any] = ..., which: str | None = None, events: str | None = None, label: str | None = None
): ...
__all__ = ["pdb_on_signal", "pdb_on_exception", "wrap_trace"]
+2
View File
@@ -99,3 +99,5 @@ class FrozenDict(dict[_KT, _VT]):
def popitem(self, *a, **kw) -> NoReturn: ...
def setdefault(self, *a, **kw) -> NoReturn: ...
def clear(self, *a, **kw) -> NoReturn: ...
__all__ = ["MultiDict", "OMD", "OrderedMultiDict", "OneToOne", "ManyToMany", "subdict", "FrozenDict"]
+2
View File
@@ -7,3 +7,5 @@ class ExceptionCauseMixin(Exception):
def get_str(self) -> str: ...
class MathError(ExceptionCauseMixin, ValueError): ...
__all__ = ["ExceptionCauseMixin"]
+2
View File
@@ -91,3 +91,5 @@ class DummyFile:
def __next__(self) -> NoReturn: ...
def __enter__(self) -> None: ...
def __exit__(self, exc_type, exc_val, exc_tb) -> None: ...
__all__ = ["mkdir_p", "atomic_save", "AtomicSaver", "FilePerms", "iter_find_files", "copytree"]
+9
View File
@@ -35,3 +35,12 @@ class DeferredValue(Generic[_T]):
def __float__(self) -> float: ...
def __unicode__(self) -> str: ...
def __format__(self, fmt: str) -> str: ...
__all__ = [
"DeferredValue",
"get_format_args",
"tokenize_format_str",
"construct_format_field_str",
"infer_positional_format_args",
"BaseFormatField",
]
+2
View File
@@ -12,3 +12,5 @@ class GCToggler:
toggle_gc: GCToggler
toggle_gc_postcollect: GCToggler
__all__ = ["get_all", "GCToggler", "toggle_gc", "toggle_gc_postcollect"]
+2
View File
@@ -23,3 +23,5 @@ class JSONLIterator:
def __iter__(self) -> Self: ...
def next(self) -> Any: ...
__next__ = next
__all__ = ["JSONLIterator", "reverse_iter_lines"]
+2
View File
@@ -28,3 +28,5 @@ BList: TypeAlias = BarrelList[_T]
class SplayList(list[_T]):
def shift(self, item_index: int, dest_index: int = 0) -> None: ...
def swap(self, item_index: SupportsIndex, dest_index: SupportsIndex) -> None: ...
__all__ = ["BList", "BarrelList"]
+2
View File
@@ -2,3 +2,5 @@ from collections.abc import Iterable
def namedtuple(typename: str, field_names: str | Iterable[str], verbose: bool = False, rename: bool = False): ...
def namedlist(typename: str, field_names: str | Iterable[str], verbose: bool = False, rename: bool = False): ...
__all__ = ["namedlist", "namedtuple"]
+2
View File
@@ -11,3 +11,5 @@ def augpath(
) -> str: ...
def shrinkuser(path: StrPath, home: str = "~") -> str: ...
def expandpath(path: StrPath) -> str: ...
__all__ = ["augpath", "shrinkuser", "expandpath"]
+2
View File
@@ -12,3 +12,5 @@ class HeapPriorityQueue(BasePriorityQueue): ...
class SortedPriorityQueue(BasePriorityQueue): ...
PriorityQueue: TypeAlias = SortedPriorityQueue
__all__ = ["PriorityQueue", "BasePriorityQueue", "HeapPriorityQueue", "SortedPriorityQueue"]
+2
View File
@@ -97,3 +97,5 @@ class _ComplementSet:
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[Any]: ...
def __bool__(self) -> bool: ...
__all__ = ["IndexedSet", "complement"]
+35
View File
@@ -64,3 +64,38 @@ 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: ...
__all__ = [
"camel2under",
"under2camel",
"slugify",
"split_punct_ws",
"unit_len",
"ordinalize",
"cardinalize",
"pluralize",
"singularize",
"asciify",
"is_ascii",
"is_uuid",
"html2text",
"strip_ansi",
"bytes2human",
"find_hashtags",
"a10n",
"gzip_bytes",
"gunzip_bytes",
"iter_splitlines",
"indent",
"escape_shell_args",
"args2cmd",
"args2sh",
"parse_int_list",
"format_int_list",
"complement_int_list",
"int_ranges_from_int_list",
"MultiReplace",
"multi_replace",
"unwrap_text",
"removeprefix",
]
+2
View File
@@ -61,3 +61,5 @@ class Table:
): ...
def get_cell_html(self, value): ...
def to_text(self, with_headers: bool = True, maxlen: Incomplete | None = None): ...
__all__ = ["Table"]
+11
View File
@@ -93,3 +93,14 @@ class ParsedException:
def from_string(cls, tb_str: str) -> Self: ...
ParsedTB = ParsedException
__all__ = [
"ExceptionInfo",
"TracebackInfo",
"Callpoint",
"ContextualExceptionInfo",
"ContextualTracebackInfo",
"ContextualCallpoint",
"print_exception",
"ParsedException",
]