> > Sounds great right? Everybody will be happy! So let's nail it down! If I > was in charge, here's what I'd do: > > * standardise the syntax for type hints in 3.5, as per PEP484 > * but: recommend the use of stub files as the preferred place to store > hints > * and: deprecate function annotations in the core language > * remove them from the core language altogether in 3.6 >
Personally, I'm not all that keen on the verbosity of the syntax; I'm sad that List[int] has to be how you spell things instead of just [int], but I'm sure there's reasons that can't work. That said, I hate stub files. I understand why they may be needed sometimes so accept them as a necessary evil, but that doesn't make them a goal to me. Stub files become "optional headers" which I'll have to keep in sync with the actual code -- which in my opinion, just about guarantees a maintenance burden that will fall by the side of the road. If I have to look at another file know or change the function arguments in the code I'm working on, that hurts readability, too. Will it take some getting used to, this syntax? Yes. At one point I thought comprehensions and ternary expressions were unreadable. I use them all the time now and find them very elegant. I'm doubtful I'll ever find type hints /elegant/, but I'm pretty sure they won't be "ugly" forever. Ugly has a lot to do with familiarity. It's also deeply subjective. But its an objective reality, imho, that having to maintain and sync up function definitions in *two different files* is a burden. And that is a burden I really don't want to deal with. --Stephen
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com