Skip to content

Commit

Permalink
Type-check the 'autodoc_intenum' example (#12827)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Oct 12, 2024
1 parent 86d1d31 commit 05679ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/development/tutorials/examples/autodoc_intenum.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ def add_directive_header(self, sig: str) -> None:
def add_content(
self,
more_content: StringList | None,
no_docstring: bool = False,
) -> None:
super().add_content(more_content, no_docstring)
super().add_content(more_content)

source_name = self.get_sourcename()
enum_object: IntEnum = self.object
use_hex = self.options.hex
self.add_line('', source_name)

for the_member_name, enum_member in enum_object.__members__.items():
for the_member_name, enum_member in enum_object.__members__.items(): # type: ignore[attr-defined]
the_member_value = enum_member.value
if use_hex:
the_member_value = hex(the_member_value)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ exclude = [
[tool.mypy]
files = [
"doc/conf.py",
"doc/development/tutorials/examples/autodoc_intenum.py",
"doc/development/tutorials/examples/helloworld.py",
"sphinx",
"tests",
"utils",
Expand Down

0 comments on commit 05679ef

Please sign in to comment.