odoo-ide / pycharm-odoo-old

PyCharm plugin for Odoo

Home Page:https://plugins.jetbrains.com/plugin/13499-odoo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use comment to hint type for variables?

tom10271 opened this issue · comments

Similar to @var Product $product in PHP. If it is not supported now can we have this in the future?

Do you mean something like this ? https://www.python.org/dev/peps/pep-0484

EDIT: Specifically in the Type comments section

Yes but not sure how to use it.

# type: List[ProductProduct] hints as ProductProduct's list but the attributes show are all attributes directly marked in that class, all attributes in base class are all missing.

I think it's because Odoo model inheritance in odoo doesn't use straightforward class inheritance, Odoo does some low level tricks to make it work and probably the type checker (in your IDE or mypy) is confused.

Yeah so that I think from plugin level it might be able to hints the IDE to know more on attributes in classes