From aae8e6ec46aa96e43c1a2a482dc7a6db7083dad6 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:38:47 +0100 Subject: [PATCH] style: Use constant convention `FOR_TYPE_HINTS` --- tools/schemapi/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/schemapi/utils.py b/tools/schemapi/utils.py index 4dd1fd2c0..9f607c65d 100644 --- a/tools/schemapi/utils.py +++ b/tools/schemapi/utils.py @@ -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": @@ -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)