[Python-ideas] PEP 484 (Type Hints) -- first draft round

Cem Karan cfkaran2 at gmail.com
Thu Jan 22 12:18:54 CET 2015


On Jan 21, 2015, at 11:47 PM, Guido van Rossum <guido at python.org> wrote:

> On Wed, Jan 21, 2015 at 8:39 PM, Eugene Toder <eltoder at gmail.com> wrote:
> On Wed, Jan 21, 2015 at 8:25 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> On 01/22/2015 01:50 PM, Guido van Rossum wrote:
> I've seen plenty of code that takes instances a certain class
> as argument and calls methods of that type but never constructs a new instance
> nor does any of the other things for which you need the class name,
> 
> If the only thing the name is needed for is static checking,
> I don't see what's so bad about not finding out until you
> actually run the static check. Adding those imports earlier
> doesn't make the code work any better or show up any more
> runtime bugs.
>  
> 
> Also, if static type checking succeeds, it will be integrated into many IDEs/editors, so you will see type checker errors even before you get to run the tests.
> 
> So I think we're all agreed that the current proposal is fine!

*grumble* ;P

I know I keep arguing for a slightly different syntax so that its easy to differentiate between type hints and other uses, but I do want to say that I like the proposal.  It seems quite practical to me.  Would you at least consider adding something to the proposal that makes it clear that a given annotation is a type and not something else?

Thanks,
Cem Karan


More information about the Python-ideas mailing list