anentropic / python-waterloo

A cli tool to convert type annotations found in 'Google-style' docstrings into mypy py2 type comments (and from there into py3 type annotations).
2 stars 0 forks source link

AttributeError: 'Node' object has no attribute 'value' #21

Closed anentropic closed 4 years ago

anentropic commented 4 years ago
  File "/Users/paul/.local/pipx/venvs/waterloo/lib/python3.7/site-packages/waterloo/refactor/utils.py", line 127, in args_annotations_match_signature
    "".join(leaf.value for leaf in element.children).split(",")
  File "/Users/paul/.local/pipx/venvs/waterloo/lib/python3.7/site-packages/waterloo/refactor/utils.py", line 127, in <genexpr>
    "".join(leaf.value for leaf in element.children).split(",")
AttributeError: 'Node' object has no attribute 'value'
anentropic commented 4 years ago

fails when function signature has args with default value 🤦

(in that case the arg itself is a Node with arg name as the first leaf and additional leaves for = etc)

anentropic commented 4 years ago

(this is a regression introduced by the signature-validating checks introduced for #16 )