Skip to content

Commit

Permalink
style: Use constant convention FOR_TYPE_HINTS
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned committed Sep 9, 2024
1 parent b3a7fb3 commit aae8e6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/schemapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def to_type_repr( # noqa: C901
Wrap the result in ``altair.typing.Optional``.
"""
tps: set[str] = set()
for_type_hints: bool = target == "annotation"
FOR_TYPE_HINTS: bool = target == "annotation"

if self.title:
if target == "annotation":
Expand All @@ -464,10 +464,10 @@ def to_type_repr( # noqa: C901
tps.add("Any")
elif self.is_literal():
tp_str = spell_literal(self.literal)
if for_type_hints:
if FOR_TYPE_HINTS:
tp_str = TypeAliasTracer.add_literal(self, tp_str, replace=True)
tps.add(tp_str)
elif for_type_hints and self.is_union_literal():
elif FOR_TYPE_HINTS and self.is_union_literal():
it = chain.from_iterable(el.literal for el in self.anyOf)
tp_str = TypeAliasTracer.add_literal(self, spell_literal(it), replace=True)
tps.add(tp_str)
Expand Down

0 comments on commit aae8e6e

Please sign in to comment.