logilab-astng #2477 false positive on class derivating from base types [open]

Dans la version en cours de dev de pylint, si on analyse tact.domain.physic, pylint dit (entre autres):

E: 78:UnitMixIn.getKUnitStr: Instance of 'unit' has no 'unitStr' member

La ligne 78, c'est le return de getKUnitStr ci dessous:

class unit(float):

    def __new__(cls, coeff=1., unitStr=''):
        inst = float.__new__(cls, coeff)
        inst.unitStr = unitStr or cls.__name__
        CONVERSION_DICT[inst.unitStr] = inst
        return inst

    def __call__(self, siValue=1.):
        return self * siValue

liter = unit(1., 'L')
second = unit(1., 's')
pulse = unit(1., 'Pulse')

class UnitMixIn(Serializable):

    def __init__(self):
        self.volumeUnit = liter
        self.timeUnit = second
        self._flowUnit = (liter, second)
        self.kUnit = (pulse, liter)

    def getKUnitStr(self):
        pulseUnit, volumeUnit = self.kUnit
        return '%s / %s' % (pulseUnit.unitStr, volumeUnit.unitStr)

Je pense que c'est un exemple (presque) minimal pour reproduire le problème.

prioritynormal
typebug
done in<not specified>
load0.500
load left0.500
closed by<not specified>