Hello Using this pylint version:
$ pylint --version pylint 0.19.0, astng 0.19.3, common 0.46.0 Python 2.5.2 The following cut-down version of a larger script raises “TypeError: '_Yes' object is not iterable”. The script as given wouldn't work, but it reproduces the error in pylint. If I change “xyz = ["foobar=%s" % options.ca,] + A + B” to “xyz = A + B + ["foobar=%s" % options.ca,]”, pylint doesn't fail with a backtrace. While the same exception, this does not seem to be a duplicate of <http://www.logilab.org/ticket/9891>. The full backtrace is at the end of this e-mail. ------------------------------------------------ #!/usr/bin/python import optparse A = [] B = [] def Test(mode): xyz = [ "foobar=%s" % options.ca, ] + A + B if options.bind is not None: xyz.append("bind=%s" % options.bind) def main(): global options parser = optparse.OptionParser() (options, args) = parser.parse_args() ------------------------------------------------ Regards, Michael --- $ pylint x ************* Module x C0111: 1: Missing docstring Traceback (most recent call last): File "/usr/bin/pylint", line 5, in <module> pkg_resources.run_script('pylint==0.19.0', 'pylint') File "…/pkg_resources.py", line 448, in run_script self.require(requires)[0].run_script(script_name, ns) File "…/pkg_resources.py", line 1166, in run_script execfile(script_filename, namespace, namespace) File "…/pylint-0.19.0-py2.5.egg/EGG-INFO/scripts/pylint", line 4, in <module> lint.Run(sys.argv[1:]) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 891, in __init__ linter.check(args) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 502, in check self.check_astng_module(astng, checkers) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 579, in check_astng_module if implements(checker, IASTNGChecker)]) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 596, in astng_events self.astng_events(child, checkers, _reversed_checkers) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 596, in astng_events self.astng_events(child, checkers, _reversed_checkers) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 596, in astng_events self.astng_events(child, checkers, _reversed_checkers) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 596, in astng_events self.astng_events(child, checkers, _reversed_checkers) File "…/pylint-0.19.0-py2.5.egg/pylint/lint.py", line 593, in astng_events checker.visit(astng) File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line 323, in visit method(node) File "…/pylint-0.19.0-py2.5.egg/pylint/checkers/typecheck.py", line 239, in visit_callfunc called = safe_infer(node.func) File "…/pylint-0.19.0-py2.5.egg/pylint/checkers/utils.py", line 38, in safe_infer value = inferit.next() File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 203, in wrapped for res in _func(node, context, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 231, in wrapper for node in func(*args, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py", line 253, in infer_getattr for owner in self.expr.infer(context): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 203, in wrapped for res in _func(node, context, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 168, in _infer_stmts for infered in stmt.infer(context): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 203, in wrapped for res in _func(node, context, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 168, in _infer_stmts for infered in stmt.infer(context): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 203, in wrapped for res in _func(node, context, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py", line 367, in infer_binop for val in _infer_binop(self.op, lhs, self.right, context, failures): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py", line 350, in _infer_binop for valnode in operand1.infer_binary_op(operator, operand2, context): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py", line 221, in wrapper for node in func(*args, **kwargs): File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/protocols.py", line 101, in tl_infer_binary_op elts = [n for elt in self.elts for n in elt.infer(context)] TypeError: '_Yes' object is not iterable _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
