[Python-projects] PyLint + rpython: TypeError: tuple indices must be integers

Maarten ter Huurne maarten.ter.huurne at philips.com
Mon Mar 5 21:45:47 CET 2007


Hi,

When checking the following program with rpython enabled:
===
def f(x):
        a = ()[x]
===

I get the following error:
===
$ pylint --version
No config file found, using default configuration
pylint 0.13.1,
astng 0.17.0, common 0.21.2
Python 2.4.3 (#2, Oct  6 2006, 07:52:30)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)]
$ pylint --rpython-mode -rn testcase1.py
No config file found, using default configuration
************* Module testcase1
W:  2: Found indentation with tabs instead of spaces
C:  1: Missing docstring
Traceback (most recent call last):
  File "/usr/bin/pylint", line 4, in ?
    lint.Run(sys.argv[1:])
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 890, in 
__init__
    linter.check(args)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 496, in 
check
    self.check_file(filepath, modname, checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 513, in 
check_file
    astng = self._check_file(filepath, modname, checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 537, in 
_check_file
    if not self.check_astng_module(astng, checkers):
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 598, in 
check_astng_module
    self.astng_events(astng, [checker for checker in checkers
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 616, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 616, in 
astng_events
    self.astng_events(child, checkers, _reversed_checkers)
  File "/usr/lib/python2.4/site-packages/pylint/lint.py", line 613, in 
astng_events
    checker.visit(astng)
  File "/usr/lib/python2.4/site-packages/logilab/astng/utils.py", line 84, 
in visit
    method(node)
  File "/usr/lib/python2.4/site-packages/pylint/checkers/rpython.py", line 
257, in visit_function
    self.check_types(node, name, node.ilookup(name), 'identifier')
  File "/usr/lib/python2.4/site-packages/pylint/checkers/rpython.py", line 
356, in check_types
    for infered in inferednodes:
  File "/usr/lib/python2.4/site-packages/logilab/astng/__init__.py", line 
122, in _infer_stmts
    for infered in stmt.infer(context):
  File "/usr/lib/python2.4/site-packages/logilab/astng/inference.py", line 
45, in wrapped
    for res in _func(node, context, **kwargs):
  File "/usr/lib/python2.4/site-packages/logilab/astng/__init__.py", line 
122, in _infer_stmts
    for infered in stmt.infer(context):
  File "/usr/lib/python2.4/site-packages/logilab/astng/inference.py", line 
45, in wrapped
    for res in _func(node, context, **kwargs):
  File "/usr/lib/python2.4/site-packages/logilab/astng/inference.py", line 
376, in infer_subscript
    assigned = self.expr.getitem(index.value)
  File "/usr/lib/python2.4/site-packages/logilab/astng/inference.py", line 
661, in tl_getitem
    return self.nodes[index]
TypeError: tuple indices must be integers
===

Bye,
                Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.logilab.org/pipermail/python-projects/attachments/20070305/07ea6896/attachment-0001.htm 


More information about the Python-Projects mailing list