I'd really like to see the video for these slides. But here's what caught my interest:<p><pre><code> Set and dict comprehensions
{x**2 for x in range(10)}
{x: x**2 for x in range(10)}
Why reduce() must die:
... the applicability of reduce() is pretty much limited
to associative operators, and in all other cases it's
better to write out the accumulation loop explicitly.
int [divided by] int should return float
nonlocal
</code></pre>
Explicit nonlocal variable modifier which (I guess) "promotes" the variable outside its local scope. Kind of the inverse of Java requiring 'final' to bind a variable to a closure.
The one thing I wish they could change in the future is forcing list and dictionary iterable same syntax:<p>instead of writing<p>for index, element in enumerate(some_list)<p>for key, value in my_dict.items()<p>they should unify and make items and enumerate default behavior. i.e.<p>for index, element in my_list:<p>for key, value in my_dict:<p>I really don't see the benefit of not doing this as default behavior. I always find if I need to loop a list there is a good chance the index can help, and even if I don't need it it doesn't hurt to have one either. Simple is better. And the whole looping dict and get back the key only sucks too because you often need the value as well so you essentially do dict["key"] but why not just default return both key and value?
"People positively hate incompatible changes – especially bad for dynamic languages", "Never again this way – the future is static analysis and annotations".<p>Wouldn't it be better to pick a better-suited language then?<p>John Carmack put it nice way:<p>"One of the lessons that we took away from Doom 3 was that script interpreters are bad, from a performance, debugging, development standpoint. It’s kind of that argument “oh but you want a free-form dynamically typed language here so you can do all of your quick, flexible stuff, and people that aren’t really programmers can do this stuff”, but you know one of the big lessons of a big project is you don’t want people that aren’t really programmers programming, you’ll suffer for it!"
Why does Guido think that slices syntax is screwed up? I mean, it's not exactly natural, but at least it's consistent (first bound is included, second is excluded):<p><pre><code> a = '12345'
a[0:-1] == '1234'
a[-1:0:-1] == '5432'
</code></pre>
Personally, I think that "downcounting" slices are rarely used. For code clarity, I prefer reversing the string/list first.
I would have been more interested in learning Python if there wasn't such a great divide. I read the first chapter of several books that said "Python 3 is out, but we're going to stick with 2.7 because too much shit is broken".
Question for the professional Python developers: do you (on a daily/weekly/monthly) basis switch between projects in Python 2 and Python 3? Is that hard to do (e.g. do you have to constantly and consciously remind yourself of syntax/semantic differences), or does your mind sort of automatically adjust to the new/old patterns?
This is my problem with Python:
"Rename func_name —> __name__, etc
Rename .next() —> .__next__()"<p>Too many ugly renames, too few alternatives of doing things. To be honest the only attractive thing to me is all the libraries that they support but I don't find the language itself interesting.
Could someone create/convert the PDF version? I don't think my computer good enough to open PPT* format<p>Edit: not really needed, just loaded the dropbox preview, it is still readable
It seems like I've been reading about the difficulties of Python V2 -> V3 for awhile. Why is that? Is this Python upgrade unusually difficult/ambitious? Or is the Python community just very reluctant to jump on new things?
As a dev that hasn't been able to move to Py3 yet (but will soon), I'm wishing they'd fix the rest of the issues, bundle PyPy, and ship Python 4 instead! Make it a compelling upgrade.<p>Then Py3 could be nicknamed "Vista," I suppose.