简体   繁体   中英

Does PyDev's type hinting support generic types?

I'd like to say something like:

'''@type foo: list<Bar>'''

and then have it know that when I access an element of foo , the resulting value is of type Bar .

Unfortunately PyDev still does not support that... (this is a shortcoming on PyDev itself and it's already reported: see: https://sw-brainwy.rhcloud.com/tracker/PyDev/147 )

Once the basic type inference can work with it, then type-hinting should have that support enable too...

两年后:正确的答案是现在使用Python的类型注释和MyPy :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM