Conversation
This is not very fair comparison, as in my experience |
|
I wasn't really trying to be fair, I guess :P. The main reason for doing it this way is that it is much nicer (and it seems pretty silly to turn simple attributes on ast nodes into methods). Many plugins would be broken doing it the other way, too. I'd rather break all the plugins (instead of just most of them :P) and end up with code we'd rather maintain in the long run, I think. |
ilevkivskyi
left a comment
There was a problem hiding this comment.
Many plugins would be broken doing it the other way, too. I'd rather break all the plugins (instead of just most of them :P) and end up with code we'd rather maintain in the long run, I think.
OK, I assume you are also volunteering to manage the community reaction to this change :-)
`sed -i -e 's/\.name()/.name/g' -e 's/\.fullname()/.fullname/g' mypy/*.py mypy/*/*.py mypyc/*.py mypyc/*/*.py misc/proper_plugin.py test-data/unit/plugins/*.py`
SymbolNode and FuncBase had name and fullname as methods while everything else has them as attributes or properties. Turn them into properties.
Fixes #7640.
This was done with
sed -i -e 's/\.name()/.name/g' -e 's/\.fullname()/.fullname/g' mypy/*.py mypy/*/*.py mypyc/*.py mypyc/*/*.py misc/proper_plugin.py test-data/unit/plugins/*.py.This is an annoying plugin compatibility break unfortunately but the name/fullname situation is very annoying so it is probably worth it.
Plugins that want to work with old and new versions can do something like:
I expect the odds that this will need to be refreshed before I merge it as approximately 100%.