Skip to content

Missing or Incomplete Type Annotations for Table Rows and Cell Paragraphs #1627

Description

@max-marek

The type information for very common operations remains incomplete or missing. Specifically, when iterating over table rows and when accessing paragraphs inside a table cell, the types are either unannotated or annotated in a way that does not propagate to the user-facing API.

Current Behavior

Iterating over table rows:

for row in table.rows:
    for cell in row.cells:  # no type hints
        ...

The _Row.cells property lacks return type annotation.

Iterating over paragraphs in a cell:

for para in cell.paragraphs:  # no type hints
    ...

The _Cell.paragraphs property lacks return type annotation too.

Impact

Static analysis fails: mypy/pyright/ty cannot catch type errors. Developers do not get suggestions for attributes.

Proposed Solution

Adopt ruff's ANN (flake8-annotations) and PYI (flake8-pyi) rules to enforce complete and correct annotations.

select = [
    "ANN",
    "PYI",
    ...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions