pylint-bot / test

0 stars 0 forks source link

object.__new__ and improper attribute lookup leads to MaximumRecursionError #204

Open pylint-bot opened 8 years ago

pylint-bot commented 8 years ago

Originally reported by: Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore?)


Related to #198. Given the following code, astroid crashes with a maximum recursion error.

#!python

from astroid.test_utils import extract_node
n = extract_node('''
class A:

    def copy(self):
        """Create a copy of the current one."""
        rv = object.__new__(self.__class__)
        rv #@
        rv.identifiers = object.__new__(self.identifiers.__class__)
        return rv
''')
print(n)
i = next(n.infer())
print(list(i.igetattr('identifiers')))