Re: Static type checking for public API

2015-10-11 Thread Aymeric Augustin
Hi John,

In case that’s not clear from the answers above, your question roughly 
translates to “can you do dozens of hours of very boring work and increase your 
maintenance workload in the future for no discernible benefit to you, just 
because I ask?” There’s no way that could be met with a positive response.

If you want maintainers to participate in a discussion rather than just find an 
excuse to brush away the idea, I suggest to say  “hello”, explain why you think 
it’s appropriate for Django to embrace this feature, argument why its benefits 
are worth the added maintenance cost, and offer to implement it.

I hope this helps,

-- 
Aymeric.



> On 11 oct. 2015, at 22:31, Florian Apolloner  wrote:
> 
> No we can't (at least not till we drop python 2). You are free to write your 
> own stub files though, this can easily live as a separate repo for now imo…
> 
> On Sunday, October 11, 2015 at 3:22:17 PM UTC+2, John Michael Lafayette wrote:
>  Python now has static type checking. All you do is follow function 
> parameters with ": paramType" and add "-> returnType" before the colon at the 
> end of the function declaration and auto-complete will work on the return 
> value in IntelliJ. Can you add the function parameter types and return types 
> to all the functions in the public API? 
> 
> > So like change this... 
> > def func(param): 
> > 
> > To this... 
> > def func(param: int) -> str: 
> 
> That way when I call a function, the static type checker will make sure I 
> pass in the right type.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-developers+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to django-developers@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-developers 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-developers/d4ad3ff3-904c-4419-9759-a71ba9aa0f32%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1F3AA66D-0E9D-4233-BF80-A36F4144C3D9%40polytechnique.org.
For more options, visit https://groups.google.com/d/optout.


Re: Static type checking for public API

2015-10-11 Thread Florian Apolloner
No we can't (at least not till we drop python 2). You are free to write 
your own stub files though, this can easily live as a separate repo for now 
imo…

On Sunday, October 11, 2015 at 3:22:17 PM UTC+2, John Michael Lafayette 
wrote:
>
>  Python now has static type checking. All you do is follow function 
> parameters with ": paramType" and add "-> returnType" before the colon at 
> the end of the function declaration and auto-complete will work on the 
> return value in IntelliJ. Can you add the function parameter types and 
> return types to all the functions in the public API? 
>
> > So like change this... 
> > def func(param): 
> > 
> > To this... 
> > def func(param: int) -> str: 
>
> That way when I call a function, the static type checker will make sure I 
> pass in the right type.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d4ad3ff3-904c-4419-9759-a71ba9aa0f32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static type checking for public API

2015-10-11 Thread Donald Stufft
It supports a mode that is comparable with Python 2.x, but which isn’t as nice. 
You essentially need to ship additional stub files that just have the type 
hints in them.

On October 11, 2015 at 1:13:20 PM, Collin Anderson (cmawebs...@gmail.com) wrote:

Hi John,

I think we need to wait until we drop Python 2.x support to be able to do this, 
as 2.x won't accept this syntax. Does that sound right?

Thanks,
Collin

On Sunday, October 11, 2015 at 9:22:17 AM UTC-4, John Michael Lafayette wrote:
 Python now has static type checking. All you do is follow function parameters 
with ": paramType" and add "-> returnType" before the colon at the end of the 
function declaration and auto-complete will work on the return value in 
IntelliJ. Can you add the function parameter types and return types to all the 
functions in the public API?

> So like change this...
> def func(param):
>
> To this...
> def func(param: int) -> str:

That way when I call a function, the static type checker will make sure I pass 
in the right type.
--
You received this message because you are subscribed to the Google Groups 
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/81f6b5a2-14a2-4a7a-82c4-74d3016ff59f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/etPan.561a9939.58492978.14b73%40Draupnir.home.
For more options, visit https://groups.google.com/d/optout.


Re: Static type checking for public API

2015-10-11 Thread Collin Anderson
Hi John,

I think we need to wait until we drop Python 2.x support to be able to do 
this, as 2.x won't accept this syntax. Does that sound right?

Thanks,
Collin

On Sunday, October 11, 2015 at 9:22:17 AM UTC-4, John Michael Lafayette 
wrote:
>
>  Python now has static type checking. All you do is follow function 
> parameters with ": paramType" and add "-> returnType" before the colon at 
> the end of the function declaration and auto-complete will work on the 
> return value in IntelliJ. Can you add the function parameter types and 
> return types to all the functions in the public API? 
>
> > So like change this... 
> > def func(param): 
> > 
> > To this... 
> > def func(param: int) -> str: 
>
> That way when I call a function, the static type checker will make sure I 
> pass in the right type.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/81f6b5a2-14a2-4a7a-82c4-74d3016ff59f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Static typing for python methods

2015-10-11 Thread Michael Manfre
Django can't include the inline type hinting syntax for many years, but we
can add stub files. Keeping the stubs in sync with the code will be more
effort and we'd want some sort of automated tooling to help with that, but
I'm not opposed to adding stub files for the public APIs. Assuming no core
devs chime in with a -1, I'd say create a ticket and you and/or others can
start working on a pull request.

Regards,
Michael Manfre

On Sun, Oct 11, 2015 at 5:00 AM, John Michael Lafayette <
johnmichaelreed...@gmail.com> wrote:

> Python now has static type checking. All you do is follow function
> parameters with ": paramType" and add "-> returnType" before the colon at
> the end of the function declaration and auto-complete will work on the
> return value in IntelliJ. Can you add the function parameter types and
> return types to all the functions in the public API?
>
> > > So like change this...
> > > def func(param):
> > >
> > > To this...
> > > def func(param: int) -> str:
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CACxkjvZUnbR1zXzAQnqdRS4vQ1Y_mJ%3DQ%3D-2Z-st5KDve48SBOA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
GPG Fingerprint: 74DE D158 BAD0 EDF8
keybase.io/manfre

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAGdCwBuqoS1hyh0KjHwZW7TWsyc5wV8YLudXaT2BBYvU9QD-0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Static typing for python methods

2015-10-11 Thread John Michael Lafayette
Python now has static type checking. All you do is follow function
parameters with ": paramType" and add "-> returnType" before the colon at
the end of the function declaration and auto-complete will work on the
return value in IntelliJ. Can you add the function parameter types and
return types to all the functions in the public API?

> > So like change this...
> > def func(param):
> >
> > To this...
> > def func(param: int) -> str:

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACxkjvZUnbR1zXzAQnqdRS4vQ1Y_mJ%3DQ%3D-2Z-st5KDve48SBOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Static type checking for public API

2015-10-11 Thread John Michael Lafayette
  Python now has static type checking. All you do is follow function parameters 
with ": paramType" and add "-> returnType" before the colon at the end of the 
function declaration and auto-complete will work on the return value in 
IntelliJ. Can you add the function parameter types and return types to all the 
functions in the public API?

> So like change this...
> def func(param):
>
> To this...
> def func(param: int) -> str:

That way when I call a function, the static type checker will make sure I pass 
in the right type.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/d38dad39-d9c0-4cdc-a547-3fa5b67fe069%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.