google / pasta

Library to refactor python code through AST manipulation.
Apache License 2.0
341 stars 40 forks source link

Missing support for Python3 features #58

Closed soupytwist closed 3 years ago

soupytwist commented 5 years ago

These AST nodes are not supported and can cause parse failures:

Will update this list as support is added.

mmv commented 5 years ago

Also missing support for PEP 448 - Additional Unpacking Generalizations

For example merged = {**a, **b} fails with a cryptic error

  File "pasta/base/annotate.py", line 804, in visit_Dict
    self.visit(key)
  File "pasta/base/annotate.py", line 1189, in visit
    fmt.set(node, 'indent', self._indent)
  File "pasta/base/formatting.py", line 37, in set
    _formatting_dict(node)[name] = value
  File "pasta/base/formatting.py", line 53, in _formatting_dict
    return getattr(node, PASTA_DICT)
AttributeError: 'NoneType' object has no attribute '__pasta__'

because the node key in visit_Dict will be None

soupytwist commented 5 years ago

Also missing support for PEP 448 - Additional Unpacking Generalizations

Thanks, split this into #64 to limit the scope of this bug.

tapaswenipathak commented 5 years ago

Hi folks: Can I take adding YieldFrom or is the ticket internal?

soupytwist commented 5 years ago

Hi folks: Can I take adding YieldFrom or is the ticket internal?

Please do!

tapaswenipathak commented 5 years ago

@soupytwist: Is there a channel where I can ask few questions or would you be ok w/ I creating a draft PR and you having a look if I understand well architecture wise?

soupytwist commented 5 years ago

I don't have a good channel for it, no. Feel free to send a draft PR for review or ask anything here. I've been meaning to add some instructions on testing locally, will do that today.

soupytwist commented 3 years ago

These have all been addressed already.