Hacker News new | ask | show | jobs
by jMyles 4055 days ago
The many more generator-style iterables give it a strange dramatic tone to me. Also, the type hints syntax looks utterly un-fun.
1 comments

You can ignore the type hints syntax. I plan to.

Python 2:

    map(func, iterable)   # returns a list
Python 3:

    map(func, iterable)         # returns an iterator
    list(map(func, iterable))   # returns a list
> You can ignore the type hints syntax. I plan to.

I feel like that will be quite an ear-plugging, eye-covering endeavor.

And that's really the point: it has the potential to create a community in which half the people are eyes-closed, ears-plugged.

On your second point: Yeah, I don't mind casting things to a list. But it does seem... I guess, dramatic.

> And that's really the point: it has the potential to create a community in which half the people are eyes-closed, ears-plugged.

This is a big concern of mine as well, both before/after listening to Guido's keynote on Type Hinting at PyCon (https://www.youtube.com/watch?v=2wDvzy6Hgxg).

At first I thought type hinting would only really see adoption in performance-oriented sections of code, but I think we're all curious to see what best practices emerge in general, and in the open source side of things. Really the additional robustness it unlocks for IDEs like JetBrains is what got me really excited about type hints in Python.

> Really the additional robustness it unlocks for IDEs like JetBrains is what got me really excited about type hints in Python.

Agreed. But that's only useful if the syntax is non-awful.

It's not technically a cast to a list. It's using the list constructor with the iterator as an argument.