/usr/share/cagefs-skeleton/opt/alt/python312/lib64/python3.12/lib2to3/fixes
"""Fixer that changes 'a ,b' into 'a, b'. This also changes '{a :b}' into '{a: b}', but does not touch other uses of colons. It does not touch other uses of whitespace. """ from .. import pytree from ..pgen2 import token from .. import fixer_base class FixWsComma(fixer_base.BaseFix): explicit = True # The user must ask for this fixers PATTERN = """ any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]> """ COMMA = pytree.Leaf(token.COMMA, ",") COLON = pytree.Leaf(token.COLON, ":") SEPS = (COMMA, COLON) def transform(self, node, results): new = node.clone() comma = False for child in new.children: if child in self.SEPS: prefix = child.prefix if prefix.isspace() and "\n" not in prefix: child.prefix = "" comma = True else: if comma: prefix = child.prefix if not prefix: child.prefix = " " comma = False return new
.
Edit
..
Edit
__init__.py
Edit
__pycache__
Edit
fix_apply.py
Edit
fix_asserts.py
Edit
fix_basestring.py
Edit
fix_buffer.py
Edit
fix_dict.py
Edit
fix_except.py
Edit
fix_exec.py
Edit
fix_execfile.py
Edit
fix_exitfunc.py
Edit
fix_filter.py
Edit
fix_funcattrs.py
Edit
fix_future.py
Edit
fix_getcwdu.py
Edit
fix_has_key.py
Edit
fix_idioms.py
Edit
fix_import.py
Edit
fix_imports.py
Edit
fix_imports2.py
Edit
fix_input.py
Edit
fix_intern.py
Edit
fix_isinstance.py
Edit
fix_itertools.py
Edit
fix_itertools_imports.py
Edit
fix_long.py
Edit
fix_map.py
Edit
fix_metaclass.py
Edit
fix_methodattrs.py
Edit
fix_ne.py
Edit
fix_next.py
Edit
fix_nonzero.py
Edit
fix_numliterals.py
Edit
fix_operator.py
Edit
fix_paren.py
Edit
fix_print.py
Edit
fix_raise.py
Edit
fix_raw_input.py
Edit
fix_reduce.py
Edit
fix_reload.py
Edit
fix_renames.py
Edit
fix_repr.py
Edit
fix_set_literal.py
Edit
fix_standarderror.py
Edit
fix_sys_exc.py
Edit
fix_throw.py
Edit
fix_tuple_params.py
Edit
fix_types.py
Edit
fix_unicode.py
Edit
fix_urllib.py
Edit
fix_ws_comma.py
Edit
fix_xrange.py
Edit
fix_xreadlines.py
Edit
fix_zip.py
Edit