-
-
Notifications
You must be signed in to change notification settings - Fork 301
Closed
Labels
Bug 🪳Good first issueFriendly and approachable by new contributorsFriendly and approachable by new contributors
Milestone
Description
Steps to reproduce
>>> fd = astroid.nodes.FunctionDef()
>>> str(fd)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jacobwalls/astroid/astroid/nodes/node_ng.py", line 219, in __str__
value = getattr(self, field)
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FunctionDef' object has no attribute 'args'
Less severely, but still not great, launching python with warnings e.g. python -Wall
:
>>> cd = astroid.nodes.ClassDef()
>>> str(cd)
/Users/.../astroid/astroid/nodes/scoped_nodes/scoped_nodes.py:2041: DeprecationWarning: The 'ClassDef.doc' attribute is deprecated, use 'ClassDef.doc_node' instead.
We should add a unittest that generates the str()
and repr()
of all node types.
python -c "from astroid import __pkginfo__; print(__pkginfo__.version)"
output
2.12.13
Metadata
Metadata
Assignees
Labels
Bug 🪳Good first issueFriendly and approachable by new contributorsFriendly and approachable by new contributors