Skip to content

Commit ca34939

Browse files
ambvhugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent b29c9b9 commit ca34939

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Lib/_colorize.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,20 @@ class ThemeSection(Mapping[str, str]):
8181

8282
def __post_init__(self) -> None:
8383
name_to_value = {}
84-
for color_name, color_field in self.__dataclass_fields__.items():
84+
for color_name in self.__dataclass_fields__:
8585
name_to_value[color_name] = getattr(self, color_name)
8686
super().__setattr__('_name_to_value', name_to_value.__getitem__)
8787

8888
def copy_with(self, **kwargs: str) -> Self:
8989
color_state: dict[str, str] = {}
90-
for color_name, color_field in self.__dataclass_fields__.items():
90+
for color_name in self.__dataclass_fields__:
9191
color_state[color_name] = getattr(self, color_name)
9292
color_state.update(kwargs)
9393
return type(self)(**color_state)
9494

9595
def no_colors(self) -> Self:
9696
color_state: dict[str, str] = {}
97-
for color_name, color_field in self.__dataclass_fields__.items():
97+
for color_name in self.__dataclass_fields__:
9898
color_state[color_name] = ""
9999
return type(self)(**color_state)
100100

@@ -228,7 +228,6 @@ def set_theme(t: Theme) -> None:
228228
global _theme
229229

230230
_theme = t
231-
return
232231

233232

234233
set_theme(default_theme)

0 commit comments

Comments
 (0)