pylint #3123 W0212 false positive on static method [resolved]
Duncan reported : class Thing(object): ''' example class ''' _next_id = 0 __slots__ = ('number', 'name') def __init__(self, name): self.number = Thing.next_id() self.name = name def __str__(self): return '(number=%d, name="%s")' % (self.number, self.name) def next_id(): ''' static method to increment "private" class attribute ''' Thing._next_id += 1 return Thing._next_id next_id = staticmethod(next_id) gives : W: 20:Thing.next_id: Access to a protected member _next_id of a client class W: 21:Thing.next_id: Access to a protected member _next_id of a client class | |
priority | normal |
---|---|
type | bug |
done in | 0.13.0 |
load | 0.250 |
load left | 0.000 |
closed by | <not specified> |