Skip to content

Commit 43ea7a0

Browse files
authored
Deprecate passing doc to Property (#1457)
1 parent 9aa1228 commit 43ea7a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

astroid/objects.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,14 @@ def qname(self):
317317
class Property(scoped_nodes.FunctionDef):
318318
"""Class representing a Python property"""
319319

320+
@decorators.deprecate_arguments(doc="Use the postinit arg 'doc_node' instead")
320321
def __init__(
321322
self, function, name=None, doc=None, lineno=None, col_offset=None, parent=None
322323
):
323324
self.function = function
324-
super().__init__(name, doc, lineno, col_offset, parent)
325+
super().__init__(name, lineno=lineno, col_offset=col_offset, parent=parent)
326+
# Assigned directly to prevent triggering the DeprecationWarning.
327+
self._doc = doc
325328

326329
# pylint: disable=unnecessary-lambda
327330
special_attributes = util.lazy_descriptor(lambda: objectmodel.PropertyModel())

0 commit comments

Comments
 (0)