Re: Typing Annotations to django core (PEP 484)

2017-03-22 Thread Tim Graham
Please search this mailing list's archives for past discussions, e.g. 
https://groups.google.com/d/topic/django-developers/trTEbURFhEY/discussion.

On Wednesday, March 22, 2017 at 8:43:22 AM UTC-4, matthaus woolard wrote:
>
>
> Django 2 will be for python 3.5+ this is the perfect time to start 
> adding Typing Annotations to django core.
>
> There is not need to add to the full code base at once, this is something 
> that could be faced in as new apis are written and added to older apis and 
> sages.
>
> In my view advantages of adding the typing are 3 fold. 
>
> 1) makes the code easier to read
> 2) IDEs (that support this) will be better able to help users, true the 
> existing type info from doc strings is used but the `typing` module 
> provides more control such as generics and typed list/dicts etc
> 3) Once complete Django can use mypy to validate the types across the code 
> base helping with reducing feature bugs through simple to fix typing issues.
>
> Im not sure if there is any large performance hit from using typing on a 
> large project like Django does anyone know of any performance metrics on 
> this?
>

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/68e60e81-08cd-4cc5-a265-f7132c3acfd9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Typing Annotations to django core (PEP 484)

2017-03-22 Thread Florian Apolloner
Hi,

On Wednesday, March 22, 2017 at 1:43:22 PM UTC+1, matthaus woolard wrote:
>
> 1) makes the code easier to read
>

I disagree, they imo make the code harder to read, especially when the 
annotations are becoming a bit more complex.
 

> Im not sure if there is any large performance hit from using typing on a 
> large project like Django does anyone know of any performance metrics on 
> this?
>

No, but if we use stub files for the annotations this should not be of any 
concern.

Cheers,
Florian 

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/bfce7a45-60d3-4012-98fe-d4a005880deb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Typing Annotations to django core (PEP 484)

2017-03-22 Thread matthaus woolard

Django 2 will be for python 3.5+ this is the perfect time to start 
adding Typing Annotations to django core.

There is not need to add to the full code base at once, this is something 
that could be faced in as new apis are written and added to older apis and 
sages.

In my view advantages of adding the typing are 3 fold. 

1) makes the code easier to read
2) IDEs (that support this) will be better able to help users, true the 
existing type info from doc strings is used but the `typing` module 
provides more control such as generics and typed list/dicts etc
3) Once complete Django can use mypy to validate the types across the code 
base helping with reducing feature bugs through simple to fix typing issues.

Im not sure if there is any large performance hit from using typing on a 
large project like Django does anyone know of any performance metrics on 
this?

-- 
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/8f4c70a4-8e40-400d-9011-d7d50e9b2174%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.