Skip to content

Commit 3a6bcd3

Browse files
committed
put _colorize.FancyCompleter in alphabetical order w.r.t. the other sections
1 parent 7f9d09c commit 3a6bcd3

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

Lib/_colorize.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,30 @@ class Difflib(ThemeSection):
183183
reset: str = ANSIColors.RESET
184184

185185

186+
@dataclass(frozen=True, kw_only=True)
187+
class FancyCompleter(ThemeSection):
188+
# functions and methods
189+
function: str = ANSIColors.BOLD_BLUE
190+
builtin_function_or_method: str = ANSIColors.BOLD_BLUE
191+
method: str = ANSIColors.BOLD_CYAN
192+
method_wrapper: str = ANSIColors.BOLD_CYAN
193+
wrapper_descriptor: str = ANSIColors.BOLD_CYAN
194+
method_descriptor: str = ANSIColors.BOLD_CYAN
195+
196+
# numbers
197+
int: str = ANSIColors.BOLD_YELLOW
198+
float: str = ANSIColors.BOLD_YELLOW
199+
complex: str = ANSIColors.BOLD_YELLOW
200+
bool: str = ANSIColors.BOLD_YELLOW
201+
202+
# others
203+
type: str = ANSIColors.BOLD_MAGENTA
204+
module: str = ANSIColors.CYAN
205+
NoneType: str = ANSIColors.GREY
206+
bytes: str = ANSIColors.BOLD_GREEN
207+
str: str = ANSIColors.BOLD_GREEN
208+
209+
186210
@dataclass(frozen=True, kw_only=True)
187211
class Syntax(ThemeSection):
188212
prompt: str = ANSIColors.BOLD_MAGENTA
@@ -219,30 +243,6 @@ class Unittest(ThemeSection):
219243
reset: str = ANSIColors.RESET
220244

221245

222-
@dataclass(frozen=True, kw_only=True)
223-
class FancyCompleter(ThemeSection):
224-
# functions and methods
225-
function: str = ANSIColors.BOLD_BLUE
226-
builtin_function_or_method: str = ANSIColors.BOLD_BLUE
227-
method: str = ANSIColors.BOLD_CYAN
228-
method_wrapper: str = ANSIColors.BOLD_CYAN
229-
wrapper_descriptor: str = ANSIColors.BOLD_CYAN
230-
method_descriptor: str = ANSIColors.BOLD_CYAN
231-
232-
# numbers
233-
int: str = ANSIColors.BOLD_YELLOW
234-
float: str = ANSIColors.BOLD_YELLOW
235-
complex: str = ANSIColors.BOLD_YELLOW
236-
bool: str = ANSIColors.BOLD_YELLOW
237-
238-
# others
239-
type: str = ANSIColors.BOLD_MAGENTA
240-
module: str = ANSIColors.CYAN
241-
NoneType: str = ANSIColors.GREY
242-
bytes: str = ANSIColors.BOLD_GREEN
243-
str: str = ANSIColors.BOLD_GREEN
244-
245-
246246
@dataclass(frozen=True, kw_only=True)
247247
class Theme:
248248
"""A suite of themes for all sections of Python.
@@ -252,20 +252,20 @@ class Theme:
252252
"""
253253
argparse: Argparse = field(default_factory=Argparse)
254254
difflib: Difflib = field(default_factory=Difflib)
255+
fancycompleter: FancyCompleter = field(default_factory=FancyCompleter)
255256
syntax: Syntax = field(default_factory=Syntax)
256257
traceback: Traceback = field(default_factory=Traceback)
257258
unittest: Unittest = field(default_factory=Unittest)
258-
fancycompleter: FancyCompleter = field(default_factory=FancyCompleter)
259259

260260
def copy_with(
261261
self,
262262
*,
263263
argparse: Argparse | None = None,
264264
difflib: Difflib | None = None,
265+
fancycompleter: FancyCompleter | None = None,
265266
syntax: Syntax | None = None,
266267
traceback: Traceback | None = None,
267268
unittest: Unittest | None = None,
268-
fancycompleter: FancyCompleter | None = None,
269269
) -> Self:
270270
"""Return a new Theme based on this instance with some sections replaced.
271271
@@ -275,10 +275,10 @@ def copy_with(
275275
return type(self)(
276276
argparse=argparse or self.argparse,
277277
difflib=difflib or self.difflib,
278+
fancycompleter=fancycompleter or self.fancycompleter,
278279
syntax=syntax or self.syntax,
279280
traceback=traceback or self.traceback,
280281
unittest=unittest or self.unittest,
281-
fancycompleter=fancycompleter or self.fancycompleter,
282282
)
283283

284284
@classmethod
@@ -292,10 +292,10 @@ def no_colors(cls) -> Self:
292292
return cls(
293293
argparse=Argparse.no_colors(),
294294
difflib=Difflib.no_colors(),
295+
fancycompleter=FancyCompleter.no_colors(),
295296
syntax=Syntax.no_colors(),
296297
traceback=Traceback.no_colors(),
297298
unittest=Unittest.no_colors(),
298-
fancycompleter=FancyCompleter.no_colors(),
299299
)
300300

301301

0 commit comments

Comments
 (0)