davidhalter / jedi

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

Inline type hinting #542

Closed blueyed closed 8 years ago

blueyed commented 9 years ago

It would be nice to allow for type hinting within a function, above an assignment.

(via https://github.com/davidhalter/jedi/issues/421#issuecomment-45447033)

davidhalter commented 9 years ago

Can you elaborate?

blueyed commented 9 years ago

I would like to use something like this:

# :type client: Client
client = get_some_client()

This could be useful when jedi does not get it correctly (as with #543).

davidhalter commented 9 years ago

Hmm, what ways of using comments as type hinting are there already (in PyCharm, PyDev, etc)?

blueyed commented 9 years ago

I don't know.

blueyed commented 9 years ago

Here's how PyDev does it: http://pydev.org/manual_adv_type_hints.html

dset0x commented 9 years ago

PyCharm has a similar feature (linking purely for inspiration) : https://www.jetbrains.com/pycharm/help/type-hinting-in-pycharm.html#d281633e18247

reinhrst commented 8 years ago

664 will allow PEP484-style type-hinting

davidhalter commented 8 years ago

I'm closing this one, because we're merging very very soon.