3 ms·
I agree. I use Python3, but for none of the reasons given. Some of the advice was just flat out bad, IMO. Like replacing def wat(a, b, *args) with
by jlarocco 12y ago
I agree. I use Python3, but for none of the reasons given. Some of the advice was just flat out bad, IMO.
Like replacing
def wat(a, b, *args)
with
def wat(*args)
a, b, args = *args
- mewwts 12y agoI'm sure (I hope) that was just a proof of concept. It's a horrible idea!
- eliben 12y agoNo one in the Python community is advocating the "replacement". I think it's just an example of new syntax.
- sourpoi 12y agoSlight typo - the sample replacement should read: def wat(*args) a, b, *args = args ..But I don't see how moving required arguments from the signature to the body (or turning a TypeError into a ValueError) might be useful, or how it differs from the presentation's first advanced unpacking example.