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

new arg signature code does not handle @module.decorator decorators 🤦‍♂️ #52

Closed anentropic closed 3 years ago

anentropic commented 3 years ago

for example:

    @classmethod
    @cache_maker.lrucache(maxsize=200)
    def category_names_by_language(cls, category_id):
        return {c.language: c.name for c in cls.objects.filter(category_id=category_id)}

the if decorator.children[1].value in _is_staticmethod raises:

AttributeError: 'PythonNode' object has no attribute 'value'

problem seems to be that cache_maker in @cache_maker.lrucache has an unexpected node type