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
"""Extend dict and Dict."""
from typing import Dict
class LittleDDict(dict):
"""An embellished dict."""
def embellishment(self) -> None:
"""Extra functionality over dict."""
print("I have %d items" % len(self))
class BigDDict(Dict[int, str]):
"""An embellished Dict."""
def embellishment(self) -> None:
"""Extra functionality over Dict."""
print("I have %d items" % len(self))
def _main() -> None:
little_d = LittleDDict()
little_d[3] = "three"
little_d.setdefault(4, "four")
little_d.embellishment()
big_d = BigDDict()
big_d[3] = "three"
big_d.setdefault(4, "four")
big_d.embellishment()
if __name__ == '__main__':
_main()
Current behavior
$ pylint --reports=n --persistent=n extend_dict.py
************* Module extend_dict
extend_dict.py:13:0: R0903: Too few public methods (1/2) (too-few-public-methods)
extend_dict.py:28:4: E1137: 'big_d' does not support item assignment (unsupported-assignment-operation)
extend_dict.py:29:4: E1101: Instance of 'BigDDict' has no 'setdefault' member (no-member)
-----------------------------------
Your code has been rated at 3.89/10
Expected behavior
$ pylint --reports=n --persistent=n extend_dict.py
Your code has been rated at 10.00/10
Is there a plan to to fix this bug? I can't upgrade my pylint (from ancient 2.3.1) due to multiple false positives connected to #3129, which is closed in favor of this ticket.
Steps to reproduce
Current behavior
Expected behavior
pylint --version output
The text was updated successfully, but these errors were encountered: