[Python-ideas] Better Type Hinting

Stefan Behnel stefan_ml at behnel.de
Fri Jun 5 07:59:58 CEST 2015


Thomas Güttler schrieb am 05.06.2015 um 07:36:
> It would be great to have better type hinting in IDEs.

Sounds more like a topic for python-list than python-ideas.


> My usecase:
> 
> logger = logging.getLogger(__name__)
> try:
>     ...
> except FooException, exc:
>     logger.warn('...')
> 
> 
> I remember there was a way to show the traceback via logger.warn().
> 
> I could use my favorite search engine, but a short cut via the IDE would
> be much easier.
> 
> How can the IDE know what kind of duck "logger" is?
> 
> Many IDEs parse the docstrings, but a lot of code does not provide it.
> 
> How can this be improved?
> 
> PS: I don't mention the name of my IDE intentionally :-)
>  It does not matter for this question.

Yes it does. It sounds like you want to use an IDE instead that supports
the above. Or install a plugin for the one you're using that improves its
capabilities for type introspection. There are a couple of IDE plugins that
embed jedi, for example.

Stefan




More information about the Python-ideas mailing list