Skip to content

Commit 2b2ad87

Browse files
committed
Iterate over Keywords when using ClassDef.get_children
1 parent 09774f6 commit 2b2ad87

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ChangeLog

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ What's New in astroid 2.5.2?
1111
============================
1212
Release Date: TBA
1313

14+
* Iterate over ``Keywords`` when using ``ClassDef.get_children``
15+
1416

1517
What's New in astroid 2.5.1?
1618
============================

astroid/scoped_nodes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ def my_meth(self, arg):
18951895
# by a raw factories
18961896

18971897
# a dictionary of class instances attributes
1898-
_astroid_fields = ("decorators", "bases", "body") # name
1898+
_astroid_fields = ("decorators", "bases", "keywords", "body") # name
18991899

19001900
decorators = None
19011901
"""The decorators that are applied to this class.
@@ -2920,6 +2920,7 @@ def get_children(self):
29202920
yield self.decorators
29212921

29222922
yield from self.bases
2923+
yield from self.keywords
29232924
yield from self.body
29242925

29252926
@decorators_mod.cached

0 commit comments

Comments
 (0)