google/pasta

Support PEP 448 - Additional Unpacking Generalizations

soupytwist opened this issue · 0 comments

(extracted from #58)

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