You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a class, whose slots are formed by concatenating other literal tuples via RUF005 style. Below B is reported to violate PLE0237, which is a false positive, I also tried a few variants of B:
C: If B is a subclass of any other class, PLE0237 seems to work fine
D: If B slots has no other literal items, PLE0237 seems to work fine
E: If B slots uses tuple concatenation, which violates RUF005, but PLE0237 seems to work fine
classA:
passclassB:
names= ("x",)
__slots__= (*names, "a")
def__init__(self) ->None:
self.x=1# PLE0237: Attribute `x` is not defined in class's `__slots__`classC(A):
names= ("x",)
__slots__= (*names, "a")
def__init__(self) ->None:
self.x=1classD:
names= ("x",)
__slots__= (*names,)
def__init__(self) ->None:
self.x=1classE:
names= ("x",)
__slots__=names+ ("a",) # RUF005: Consider `(*names, "a")` instead of concatenationdef__init__(self) ->None:
self.x=1
The text was updated successfully, but these errors were encountered:
I have a class, whose slots are formed by concatenating other literal tuples via RUF005 style. Below
B
is reported to violate PLE0237, which is a false positive, I also tried a few variants ofB
:C
: IfB
is a subclass of any other class, PLE0237 seems to work fineD
: IfB
slots has no other literal items, PLE0237 seems to work fineE
: IfB
slots uses tuple concatenation, which violates RUF005, but PLE0237 seems to work fineThe text was updated successfully, but these errors were encountered: