davidhalter / jedi

Awesome autocompletion, static analysis and refactoring library for python
http://jedi.readthedocs.io
Other
5.82k stars 508 forks source link

python 2.7 function type hint workaround #698

Closed xuboying closed 8 years ago

xuboying commented 8 years ago

Really happy to see the improvement for PEP484 type hint, on linter branch Thanks a lot! btw, Is there a better workaround than this:

def test(e):
    e = e #type: list
    e.append(1)
davidhalter commented 8 years ago

How do you mean better?

xuboying commented 8 years ago

HI David, You've answered my previous issue: https://github.com/davidhalter/jedi-vim/issues/521 Thanks a lot for that. I'm new to python, but I really need type hint for gui frameworks. the e=e looks a bit funny, but actually work, if there is a style which does not need assignment, it could be better

davidhalter commented 8 years ago

Are you using Python 3?

xuboying commented 8 years ago

No, I'm still suing Python 2.7 for compatibility reason. I'm aware of the benfit of using python3 but will not switch soon.

davidhalter commented 8 years ago

We haven't implemented all of PEP484. Once we have it will be a bit easier and a single comment will be enough.