Skip to content

Commit

Permalink
Squash is_property_deleter and use is_property_setter_or_deleter instead
Browse files Browse the repository at this point in the history
  • Loading branch information
PCManticore committed Oct 16, 2019
1 parent 32aad00 commit 273412f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pylint/checkers/base.py
Expand Up @@ -52,7 +52,7 @@
import pylint.utils as lint_utils
from pylint import checkers, exceptions, interfaces
from pylint.checkers import utils
from pylint.checkers.utils import is_property_deleter, is_property_setter
from pylint.checkers.utils import is_property_setter_or_deleter
from pylint.reporters.ureports import nodes as reporter_nodes


Expand Down Expand Up @@ -316,7 +316,7 @@ def _determine_function_name_type(node, config=None):
if not node.is_method():
return "function"

if is_property_setter(node) or is_property_deleter(node):
if is_property_setter_or_deleter(node):
# If the function is decorated using the prop_method.{setter,getter}
# form, treat it like an attribute as well.
return "attr"
Expand Down Expand Up @@ -2013,7 +2013,7 @@ def visit_classdef(self, node):
def visit_functiondef(self, node):
if self.config.no_docstring_rgx.match(node.name) is None:
ftype = "method" if node.is_method() else "function"
if is_property_setter(node) or is_property_deleter(node):
if is_property_setter_or_deleter(node):
return

if isinstance(node.parent.frame(), astroid.ClassDef):
Expand Down
5 changes: 0 additions & 5 deletions pylint/checkers/utils.py
Expand Up @@ -731,11 +731,6 @@ def is_property_setter(node: astroid.FunctionDef) -> bool:
return _is_property_kind(node, "setter")


def is_property_deleter(node: astroid.FunctionDef) -> bool:
"""Check if the given node is a property deleter"""
return _is_property_kind(node, "deleter")


def is_property_setter_or_deleter(node: astroid.FunctionDef) -> bool:
"""Check if the given node is either a property setter or a deleter"""
return _is_property_kind(node, "setter", "deleter")
Expand Down

0 comments on commit 273412f

Please sign in to comment.