Skip to content
Merged
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
5 changes: 1 addition & 4 deletions stubs/docutils/docutils/nodes.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from typing import Any, List

class reference:
def __init__(self, rawsource: str = ..., text: str = ..., *children: List[Any], **attributes: Any) -> None: ...
from typing import Any

def __getattr__(name: str) -> Any: ... # incomplete

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my own knowledge, does this __getattr__ act as a catch-all for undefined objects or something?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this means that every name can be imported from docutils.nodes and is treated as Any. So docutils.nodes.reference is Any for now, so it should at least report no wrong errors. Of course it would be better to have proper type annotations here.