Skip to content

Commit 040103a

Browse files
authored
Add missing symbols to tabulate (#9781)
1 parent 41d7ddb commit 040103a

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

stubs/tabulate/tabulate/__init__.pyi

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
from collections.abc import Callable, Container, Iterable, Mapping, Sequence
22
from typing import Any, NamedTuple
3-
from typing_extensions import TypeAlias
3+
from typing_extensions import Final, Self, TypeAlias
44

5-
__version__: str
5+
from .version import __version__ as __version__
66

7-
LATEX_ESCAPE_RULES: dict[str, str]
8-
MIN_PADDING: int
7+
__all__ = ["tabulate", "tabulate_formats", "simple_separated_format"]
8+
9+
# These constants are meant to be configurable
10+
# https://github.com/astanin/python-tabulate#text-formatting
911
PRESERVE_WHITESPACE: bool
12+
MIN_PADDING: int
13+
# https://github.com/astanin/python-tabulate#wide-fullwidth-cjk-symbols
1014
WIDE_CHARS_MODE: bool
11-
multiline_formats: dict[str, str]
12-
tabulate_formats: list[str]
15+
SEPARATING_LINE: str
1316

1417
class Line(NamedTuple):
1518
begin: str
@@ -35,6 +38,10 @@ class TableFormat(NamedTuple):
3538
padding: int
3639
with_header_hide: Container[str] | None
3740

41+
LATEX_ESCAPE_RULES: Final[dict[str, str]]
42+
tabulate_formats: list[str]
43+
multiline_formats: dict[str, str]
44+
3845
def simple_separated_format(separator: str) -> TableFormat: ...
3946
def tabulate(
4047
tabular_data: Mapping[str, Iterable[Any]] | Iterable[Iterable[Any]],
@@ -52,3 +59,7 @@ def tabulate(
5259
rowalign: str | Iterable[str] | None = ...,
5360
maxheadercolwidths: int | Iterable[int] | None = ...,
5461
) -> str: ...
62+
63+
class JupyterHTMLStr(str):
64+
@property
65+
def str(self) -> Self: ...
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
version: str
2-
version_tuple: tuple[int, int, int]
3-
__version_tuple__: tuple[int, int, int]
1+
from typing_extensions import Final
2+
3+
version: Final[str]
4+
__version__: Final[str]
5+
version_tuple: Final[tuple[int, int, int]]
6+
__version_tuple__: Final[tuple[int, int, int]]

0 commit comments

Comments
 (0)