Ten awesome things you are missing out on if you're still using Python 2

Ian Kelly ian.g.kelly at gmail.com
Mon May 8 11:02:13 EDT 2017


Overall a nice preso. I disagree with the slides on a few points.

Slide 8: I don't see why I would want to refactor

def f(a, b, *args):
    stuff

into

def f(*args):
    a, b, *args = args
    stuff

The first one has a cleaner signature and is also shorter.

Slide 55: What makes the "Better" example better than the "Good" example?
Creating a 2-element list just to yield from it seems wasteful, and for
readability I prefer the version with two yields.

Slide 56: "If you need a list (e.g., for slicing), just call list() on the
generator." No, if you need to slice an iterator, use islice, Then call
list() only if you still need a list for some other reason.

Slide 58: "Not going to lie to you. I still don't get this." Uh, sure,
great sales pitch there. If the author doesn't understand asyncio, then why
include it in the list?

On Mon, May 8, 2017 at 1:17 AM, Steven D'Aprano <steve at pearwood.info> wrote:

>
> http://www.asmeurer.com/python3-presentation/slides.html#1
>
>
> (The web UI is a bit ~~crap~~ minimialist. Use the left and right arrow
> keys to advance backwards and forwards among the slides.)
>
>
>
> --
> Steve
> Emoji: a small, fuzzy, indistinct picture used to replace a clear and
> perfectly comprehensible word.
> --
> https://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list