PATH: //usr/lib64/python3.9/lib2to3/fixes
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 __init__.py
↓
X
📁 __pycache__/
X
📄 fix_apply.py
↓
X
📄 fix_asserts.py
↓
X
📄 fix_basestring.py
↓
X
📄 fix_buffer.py
↓
X
📄 fix_dict.py
↓
X
📄 fix_except.py
↓
X
📄 fix_exec.py
↓
X
📄 fix_execfile.py
↓
X
📄 fix_exitfunc.py
↓
X
📄 fix_filter.py
↓
X
📄 fix_funcattrs.py
↓
X
📄 fix_future.py
↓
X
📄 fix_getcwdu.py
↓
X
📄 fix_has_key.py
↓
X
📄 fix_idioms.py
↓
X
📄 fix_import.py
↓
X
📄 fix_imports.py
↓
X
📄 fix_imports2.py
↓
X
📄 fix_input.py
↓
X
📄 fix_intern.py
↓
X
📄 fix_isinstance.py
↓
X
📄 fix_itertools.py
↓
X
📄 fix_itertools_imports.py
↓
X
📄 fix_long.py
↓
X
📄 fix_map.py
↓
X
📄 fix_metaclass.py
↓
X
📄 fix_methodattrs.py
↓
X
📄 fix_ne.py
↓
X
📄 fix_next.py
↓
X
📄 fix_nonzero.py
↓
X
📄 fix_numliterals.py
↓
X
📄 fix_operator.py
↓
X
📄 fix_paren.py
↓
X
📄 fix_print.py
↓
X
📄 fix_raise.py
↓
X
📄 fix_raw_input.py
↓
X
📄 fix_reduce.py
↓
X
📄 fix_reload.py
↓
X
📄 fix_renames.py
↓
X
📄 fix_repr.py
↓
X
📄 fix_set_literal.py
↓
X
📄 fix_standarderror.py
↓
X
📄 fix_sys_exc.py
↓
X
📄 fix_throw.py
↓
X
📄 fix_tuple_params.py
↓
X
📄 fix_types.py
↓
X
📄 fix_unicode.py
↓
X
📄 fix_urllib.py
↓
X
📄 fix_ws_comma.py
↓
X
📄 fix_xrange.py
↓
X
📄 fix_xreadlines.py
↓
X
📄 fix_zip.py
↓
X
SAVING...
BERHASIL DIUBAH!
EDITING: fix_isinstance.py
# Copyright 2008 Armin Ronacher. # Licensed to PSF under a Contributor Agreement. """Fixer that cleans up a tuple argument to isinstance after the tokens in it were fixed. This is mainly used to remove double occurrences of tokens as a leftover of the long -> int / unicode -> str conversion. eg. isinstance(x, (int, long)) -> isinstance(x, (int, int)) -> isinstance(x, int) """ from .. import fixer_base from ..fixer_util import token class FixIsinstance(fixer_base.BaseFix): BM_compatible = True PATTERN = """ power< 'isinstance' trailer< '(' arglist< any ',' atom< '(' args=testlist_gexp< any+ > ')' > > ')' > > """ run_order = 6 def transform(self, node, results): names_inserted = set() testlist = results["args"] args = testlist.children new_args = [] iterator = enumerate(args) for idx, arg in iterator: if arg.type == token.NAME and arg.value in names_inserted: if idx < len(args) - 1 and args[idx + 1].type == token.COMMA: next(iterator) continue else: new_args.append(arg) if arg.type == token.NAME: names_inserted.add(arg.value) if new_args and new_args[-1].type == token.COMMA: del new_args[-1] if len(new_args) == 1: atom = testlist.parent new_args[0].prefix = atom.prefix atom.replace(new_args[0]) else: args[:] = new_args node.changed()
SIMPAN PERUBAHAN