Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd authored Nov 20, 2024
1 parent 2efb298 commit 784e9e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions comtypes/tools/codegenerator/codegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,22 +859,22 @@ def ComInterfaceBody(self, body: typedesc.ComInterfaceBody) -> None:
f"# def {name}({', '.join(['self'] + inargs)}):",
file=self.stream,
)
print(f"# {doc!r}", file=self.stream)
print(f"# {(doc or '-no docstring-')!r}", file=self.stream)
print(f"# #return {', '.join(outargs)}", file=self.stream)
elif typ == 1: # propget
print("# @property", file=self.stream)
print(
f"# def {name}({', '.join(['self'] + inargs)}):",
file=self.stream,
)
print(f"# {doc!r}", file=self.stream)
print(f"# {(doc or '-no docstring-')!r}", file=self.stream)
print(f"# #return {', '.join(outargs)}", file=self.stream)
elif typ == 2: # propput
print(
f"# def _set({', '.join(['self'] + inargs + outargs)}):",
file=self.stream,
)
print(f"# {doc!r}", file=self.stream)
print(f"# {(doc or '-no docstring-')!r}", file=self.stream)
print(
f"# {name} = property(fset = _set, doc = _set.__doc__)",
file=self.stream,
Expand All @@ -884,13 +884,13 @@ def ComInterfaceBody(self, body: typedesc.ComInterfaceBody) -> None:
f"# def _get({', '.join(['self'] + inargs)}):",
file=self.stream,
)
print(f"# {doc!r}", file=self.stream)
print(f"# {(doc or '-no docstring-')!r}", file=self.stream)
print(f"# #return {', '.join(outargs)}", file=self.stream)
print(
f"# def _set({', '.join(['self'] + inargs + outargs)}):",
file=self.stream,
)
print(f"# {doc!r}", file=self.stream)
print(f"# {(doc or '-no docstring-')!r}", file=self.stream)
print(
f"# {name} = property(_get, _set, doc = _set.__doc__)",
file=self.stream,
Expand Down

0 comments on commit 784e9e6

Please sign in to comment.