Skip to content

Commit

Permalink
Change rendering of predicate types (#88)
Browse files Browse the repository at this point in the history
I think this is clearer
  • Loading branch information
hoodmane authored Sep 29, 2023
1 parent 1faf61f commit 213a1c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sphinx_js/typedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,9 +1165,10 @@ class PredicateType(TypeBase):
targetType: "TypeD"

def _render_name_root(self, converter: Converter) -> Iterator[str | ir.TypeXRef]:
yield self.name
yield " is "
yield ir.TypeXRefIntrinsic("boolean")
yield " (typeguard for "
yield from self.targetType.render_name(converter)
yield ")"


AnyNode = Node | Project | Signature
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build_ts/test_build_ts.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def test_predicate(self):
* **c** (any) --
Returns:
c is "ConstructorlessClass()"
boolean (typeguard for "ConstructorlessClass()")
"""
),
)
Expand Down

0 comments on commit 213a1c6

Please sign in to comment.