diff options
author | Dani Alcala <112832187+clavedeluna@users.noreply.github.com> | 2022-10-20 11:35:53 -0300 |
---|---|---|
committer | Marc Mueller <30130371+cdce8p@users.noreply.github.com> | 2022-10-21 17:18:24 +0200 |
commit | c2d42bad23d012ff7dee0da3189145d801cc0229 (patch) | |
tree | 7d0710e90e5cc9104005071beaa331a427a7a630 /tests | |
parent | e8dc9b61da9840336277344939141d3a4c4b77df (diff) | |
download | pylint-git-c2d42bad23d012ff7dee0da3189145d801cc0229.tar.gz |
Remove __index__ from unnecessary-dunder-call check (#7650)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/u/unnecessary/unnecessary_dunder_call.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/functional/u/unnecessary/unnecessary_dunder_call.py b/tests/functional/u/unnecessary/unnecessary_dunder_call.py index cd1f21286..18e4ef855 100644 --- a/tests/functional/u/unnecessary/unnecessary_dunder_call.py +++ b/tests/functional/u/unnecessary/unnecessary_dunder_call.py @@ -122,3 +122,9 @@ INSTANTIATED_SELF = int("1").__add__(1) # [unnecessary-dunder-call] # since we can't apply alternate operators/functions here. a = [1, 2, 3] assert super(type(a), a).__str__() == "[1, 2, 3]" + +class MyString(str): + """Custom str implementation""" + def rjust(self, width, fillchar= ' '): + """Acceptable call to __index__""" + width = width.__index__() |