[Python-projects] PyLint + rpython: AttributeError: Lambda instance has no attribute 'pytype'

Maarten ter Huurne maarten.ter.huurne at philips.com
Mon Mar 5 22:00:52 CET 2007


Hi,

When checking the following program with rpython enabled:
===
def f():
        g = lambda: None
===

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 testcase3.py
No config file found, using default configuration
************* Module testcase3
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 
363, in check_types
    types.add(infered.pytype())
AttributeError: Lambda instance has no attribute 'pytype'
===

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


More information about the Python-Projects mailing list