Hi, On Sunday, January 8, 2017 at 8:43:46 AM UTC+1, roboslone wrote: > > As Django user, I have to say type hinting would help a lot to understand > how things work in Django without looking at docs. It could save a lot of > time for beginners, too. >
I've been working with "type hinting" in CPP and Java IDEs for years and can't say that they saved me from looking at the Docs. Quite often they actually made me write worse code since I was missing tips from the documentation. I nowadays quite often just work with in-file completion, nothing fancy. Also I have to mention, that PyCharm (which is the most popular IDE for > Python, I believe) has support for type hinting and could help you avoid > many problems before even firing up a server. > Cannot speak for PyCharm, I try it once a year or so and am so annoyed by it that I drop it before the end of the day usually. > In my opinion not adding type hints in Django 2.0 would be a mistake. > Maybe, but that will require someone convinced to step up. All I hear so far is that type hinting would be nice to have, but I do not see any concrete proposals anywhere. And even if we allow python 3.4, we can support type hinting via stub files. > Using Django 2.0 in existing project would require rewriting some bits > anyway (correct me if I'm wrong) > Not more rewriting than lets say 1.10 -> 1.11, the increase in the version number is because we are dropping python 2, not because we are going to break backwards compat like rails 3 -> 4 (excuse me if I got the version numbers wrong) > If you're rewriting your code to use new version of Django, you could as > well use new version of Python. > I'd be honestly surprised by that, updating Django is way easier than installing a new Python version. > Sticking to 3.6 would allow using format strings, and that would greatly > increase readability (looking at %-strings here). > Knowing what certain members of the core team think about those f-strings, I think there will be first a big discussion if we will allow them at all in Django's codebase. Then there are further things to consider like gettext support etc… > I have to add, that nowadays deploying python applications with desired > version of Python is fairly easy. One could use relocatable virtualenvs, > Docker containers and so on. > No it is not that easy, even if you make a venv relocatable it is not ment to be copied to a system not supporting that python version. And sadly containers are not always an option. > So even if you're on an outdated distro (or something like RHEL, that > wouldn't get new python version in ages, probably) and your OS is stuck > with older version of Python, your application doesn't have to be. > I guess that is where we have to disagree. and developers could start enjoying new Python features a year or two > earlier. > Noone is stopping you to use new Python features in your own code, but there is currently no convincing reason to force Django onto a new Python version imo. 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 [email protected]. To post to this group, send email to [email protected]. 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/752d1db0-ca10-4a3c-822a-d623cda98652%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
