Skip to content

Commit

Permalink
add the "__prepare__" method to the list of recognized dunder methods…
Browse files Browse the repository at this point in the history
… in the ruff_linter package.
  • Loading branch information
takaya0 committed Jan 15, 2024
1 parent 66804ec commit 98a9db3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def _(self):
def __special_custom_magic__(self):
pass

@classmethod
def __prepare__():
pass


def __foo_bar__(): # this is not checked by the [bad-dunder-name] rule
...
1 change: 1 addition & 0 deletions crates/ruff_linter/src/rules/pylint/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ pub(super) fn is_known_dunder_method(method: &str) -> bool {
| "__pos__"
| "__post_init__"
| "__pow__"
| "__prepare__"
| "__radd__"
| "__rand__"
| "__rdivmod__"
Expand Down

0 comments on commit 98a9db3

Please sign in to comment.