@@ -1503,11 +1503,8 @@ class FunctionDef(mixins.MultiLineBlockMixin, node_classes.Statement, Lambda):
1503
1503
_astroid_fields = ("decorators" , "args" , "returns" , "body" )
1504
1504
_multi_line_block_fields = ("body" ,)
1505
1505
returns = None
1506
- decorators = None
1507
- """The decorators that are applied to this method or function.
1508
-
1509
- :type: Decorators or None
1510
- """
1506
+ decorators : Optional [node_classes .Decorators ] = None
1507
+ """The decorators that are applied to this method or function."""
1511
1508
special_attributes = FunctionModel ()
1512
1509
"""The names of special attributes that this function has.
1513
1510
@@ -1606,7 +1603,7 @@ def postinit(
1606
1603
self ,
1607
1604
args : Arguments ,
1608
1605
body ,
1609
- decorators = None ,
1606
+ decorators : Optional [ node_classes . Decorators ] = None ,
1610
1607
returns = None ,
1611
1608
type_comment_returns = None ,
1612
1609
type_comment_args = None ,
@@ -1634,21 +1631,19 @@ def postinit(
1634
1631
self .type_comment_args = type_comment_args
1635
1632
1636
1633
@decorators_mod .cachedproperty
1637
- def extra_decorators (self ):
1634
+ def extra_decorators (self ) -> List [ node_classes . Call ] :
1638
1635
"""The extra decorators that this function can have.
1639
1636
1640
1637
Additional decorators are considered when they are used as
1641
1638
assignments, as in ``method = staticmethod(method)``.
1642
1639
The property will return all the callables that are used for
1643
1640
decoration.
1644
-
1645
- :type: list(NodeNG)
1646
1641
"""
1647
1642
frame = self .parent .frame (future = True )
1648
1643
if not isinstance (frame , ClassDef ):
1649
1644
return []
1650
1645
1651
- decorators = []
1646
+ decorators : List [ node_classes . Call ] = []
1652
1647
for assign in frame ._get_assign_nodes ():
1653
1648
if isinstance (assign .value , node_classes .Call ) and isinstance (
1654
1649
assign .value .func , node_classes .Name
0 commit comments