From 60e6a3560ede14807a8c7e425c553d91fdc8a18c Mon Sep 17 00:00:00 2001 From: alexander-held <45009355+alexander-held@users.noreply.github.com> Date: Fri, 18 Dec 2020 19:21:22 +0100 Subject: [PATCH] fix: support dictionaries as table headers (#4835) Fixes #4829 --- third_party/2and3/tabulate.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/tabulate.pyi b/third_party/2and3/tabulate.pyi index d046f36e3..dc935400e 100644 --- a/third_party/2and3/tabulate.pyi +++ b/third_party/2and3/tabulate.pyi @@ -1,4 +1,4 @@ -from typing import Any, Callable, Container, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Union +from typing import Any, Callable, Container, Dict, Iterable, List, Mapping, NamedTuple, Optional, Sequence, Union PRESERVE_WHITESPACE: bool WIDE_CHARS_MODE: bool @@ -31,7 +31,7 @@ class TableFormat(NamedTuple): def simple_separated_format(separator: str) -> TableFormat: ... def tabulate( tabular_data: Union[Mapping[str, Iterable[Any]], Iterable[Iterable[Any]]], - headers: Union[str, Sequence[str]] = ..., + headers: Union[str, Dict[str, str], Sequence[str]] = ..., tablefmt: Union[str, TableFormat] = ..., floatfmt: Union[str, Iterable[str]] = ..., numalign: Optional[str] = ...,