Skip to content

Commit

Permalink
add more test examples
Browse files Browse the repository at this point in the history
  • Loading branch information
clavedeluna committed Oct 18, 2022
1 parent ed43df2 commit 80363f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylint/checkers/dunder_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
}


EXTRA_DUNDER_METHODS: list = [
EXTRA_DUNDER_METHODS = [
"__new__",
"__subclasses__",
"__init_subclass__",
Expand All @@ -134,10 +134,10 @@
"__setstate__",
"__reduce__",
"__reduce_ex__",
"__post_init__", # part of dataclasses module
"__post_init__", # part of dataclasses module
]

DUNDER_PROPERTIES: list = [
DUNDER_PROPERTIES = [
"__class__",
"__dict__",
"__doc__",
Expand Down
6 changes: 6 additions & 0 deletions tests/functional/b/bad_dunder_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ def __inv__(self): # [bad-dunder-name]
# author likely meant to call the invert dunder method
pass

def _protected_method(self):
print("Protected")

def __private_method(self):
print("Private")

@property
def __doc__(self):
return "Docstring"
Expand Down

0 comments on commit 80363f7

Please sign in to comment.