[Python-ideas] Better Type Hinting

Thomas Güttler guettliml at thomas-guettler.de
Fri Jun 5 09:21:33 CEST 2015



Am 05.06.2015 um 08:19 schrieb Stephen Hansen:
> On Thu, Jun 4, 2015, at 11:01 PM, Andrew Barnert via Python-ideas wrote:
>> On Jun 4, 2015, at 22:36, Thomas Güttler <guettliml at thomas-guettler.de>
>> wrote:
>>>
>>> It would be great to have better type hinting in IDEs.
>>
>> Is PEP 484 not sufficient for this purpose?
>
> It's really not.
>
> For one thing, PEP 484 isn't going to result in the standard library
> being hinted all up (though I assume someone may make stubs). But
> really, the specific issue that the OP is running into is because of the
> signature of logging.warn --  msg, *args, **kwargs.

I am using logger.warn() not logging.warn().

The question is: How to know which kind of duck "logger" is?

"logger" was created by "logging.getLogger(__name__)"

It is not the question how to implement better guessing in the IDE.

The basics needs to be solved. Everything else is "toilet paper programming"
(Ah, smell inside, ... let's write an wrapper ...)

Regards,
   Thomas Güttler


More information about the Python-ideas mailing list