Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions stubs/docutils/docutils/parsers/rst/directives/tables.pyi
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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):
Expand Down Expand Up @@ -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): ...
Expand All @@ -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: ...
2 changes: 1 addition & 1 deletion stubs/docutils/docutils/parsers/rst/states.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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): ...
Expand Down
Loading