diff --git a/stubs/docutils/docutils/parsers/rst/directives/tables.pyi b/stubs/docutils/docutils/parsers/rst/directives/tables.pyi index ebde406d577e..cf0022f3f005 100644 --- a/stubs/docutils/docutils/parsers/rst/directives/tables.pyi +++ b/stubs/docutils/docutils/parsers/rst/directives/tables.pyi @@ -1,8 +1,9 @@ import csv from _typeshed import Incomplete -from collections.abc import Callable +from collections.abc import Callable, Sequence from typing import ClassVar, Final +from docutils import nodes from docutils.parsers.rst import Directive __docformat__: Final = "reStructuredText" @@ -20,7 +21,7 @@ class Table(Directive): def extend_short_rows_with_empty_cells(self, columns, parts) -> None: ... class RSTTable(Table): - def run(self): ... + def run(self) -> Sequence[nodes.table | nodes.system_message]: ... class CSVTable(Table): class DocutilsDialect(csv.Dialect): @@ -48,7 +49,7 @@ class CSVTable(Table): @staticmethod def check_requirements() -> None: ... def process_header_option(self): ... - def run(self): ... + def run(self) -> Sequence[nodes.table | nodes.system_message]: ... def get_csv_data(self): ... @staticmethod def decode_from_csv(s): ... @@ -57,6 +58,6 @@ class CSVTable(Table): def parse_csv_data_into_rows(self, csv_data, dialect, source): ... class ListTable(Table): - def run(self): ... + def run(self) -> Sequence[nodes.table | nodes.system_message]: ... def check_list_content(self, node): ... - def build_table_from_list(self, table_data, col_widths, header_rows, stub_columns): ... + def build_table_from_list(self, table_data, col_widths, header_rows, stub_columns) -> nodes.table: ... diff --git a/stubs/docutils/docutils/parsers/rst/states.pyi b/stubs/docutils/docutils/parsers/rst/states.pyi index 169b1699c7b4..c8e26855b6cc 100644 --- a/stubs/docutils/docutils/parsers/rst/states.pyi +++ b/stubs/docutils/docutils/parsers/rst/states.pyi @@ -219,7 +219,7 @@ class Body(RSTState): def isolate_grid_table(self): ... def isolate_simple_table(self): ... def malformed_table(self, block, detail: str = "", offset: int = 0): ... - def build_table(self, tabledata, tableline, stub_columns: int = 0, widths=None): ... + def build_table(self, tabledata, tableline, stub_columns: int = 0, widths=None) -> nodes.table: ... def build_table_row(self, rowdata, tableline): ... explicit: Incomplete def footnote(self, match): ...