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
Some users say that d.__delitem__('a') should not be used. And it is perfectly reasonable, since both del and __delitem__ magic method are restricted.
But, this maid me think about general case: should we allow to call magic methods directly?
Reasoning
We already disallow to use protected attributes and methods. This might be similar.
But, we need to think about all possible cases like .__dict__, .__mro__, etc.
So, there are two way to go:
Forbid to use all forbidden magic method calls from the instance: d.__delitem__('a')
Forbid to use any magic methods directly (need deeper investigation)
The text was updated successfully, but these errors were encountered:
From my research I have not found any valid magic attributes in all my source code.
Even if there are any direct magic method invocations - then it should be marked as noqa.
Rule request
Thesis
Some users say that
d.__delitem__('a')
should not be used. And it is perfectly reasonable, since bothdel
and__delitem__
magic method are restricted.But, this maid me think about general case: should we allow to call magic methods directly?
Reasoning
We already disallow to use protected attributes and methods. This might be similar.
But, we need to think about all possible cases like
.__dict__
,.__mro__
, etc.So, there are two way to go:
d.__delitem__('a')
The text was updated successfully, but these errors were encountered: