Comment 12 for bug 456870

Revision history for this message
Edward K. Ream (edreamleo) wrote :

The failing code appears to be _set_proxied in inference.py.

def _set_proxied(const):

    if not hasattr(const, '__proxied'):
        const.__proxied = _CONST_PROXY[const.value.__class__]
    return const.__proxied
nodes.Const._proxied = property(_set_proxied)

The call to hasattr can call Proxy.__getattr__ in infutils.py:

def __getattr__(self, name):
        if name == '_proxied':
            return getattr(self.__class__, '_proxied')
        if name in self.__dict__:
            return self.__dict__[name]
        return getattr(self._proxied, name)

As the trace shows, the last line of __getattr__ can invoke _setProxied, apparently directly.

My head is about to explode :-) In particular, the const argument to _set_proxied apparently represents None without being None. The debugger reports const to be:

<Instance of __builtin__.NoneType at (an address)>

but "const is None" evaluates to False. Ditto for various other tries, such as isinstance(const,something-or-other)

As if that were not enough, did you notice _proxied vs. __proxied?

I do hope somebody who actually understand this code will fix it. To repeat, pylint has been failing to catch serious bugs in my app as a result of this problem. I've pretty much lost confidence in pylint for now.

Edward