[docutils] Add return types for a few docutils table methods (#14493)

This commit is contained in:
Adam Dangoor
2025-08-08 11:14:58 +01:00
committed by GitHub
parent 351439739c
commit c3a880b428
2 changed files with 7 additions and 6 deletions
@@ -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: ...
@@ -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): ...