From 43ea7a00bd07779ccb5209e4a082fc7ac6c9f6d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Wed, 9 Mar 2022 21:54:23 +0100 Subject: [PATCH] Deprecate passing ``doc`` to ``Property`` (#1457) --- astroid/objects.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astroid/objects.py b/astroid/objects.py index 37ab87d32b..3544a2dec8 100644 --- a/astroid/objects.py +++ b/astroid/objects.py @@ -317,11 +317,14 @@ def qname(self): class Property(scoped_nodes.FunctionDef): """Class representing a Python property""" + @decorators.deprecate_arguments(doc="Use the postinit arg 'doc_node' instead") def __init__( self, function, name=None, doc=None, lineno=None, col_offset=None, parent=None ): self.function = function - super().__init__(name, doc, lineno, col_offset, parent) + super().__init__(name, lineno=lineno, col_offset=col_offset, parent=parent) + # Assigned directly to prevent triggering the DeprecationWarning. + self._doc = doc # pylint: disable=unnecessary-lambda special_attributes = util.lazy_descriptor(lambda: objectmodel.PropertyModel())