Applications Google
Menu principal

Post a Comment On: Only Python

"Python's tug of war between beginner-friendly features and support for advanced users"

7 Comments -

1 – 7 of 7
Blogger KeithCu said...

Great article.

This is a big challenge across Python. Another example is the ":=" operator.

Try explaining that variation on equals to an 8 year old. And notice that even advanced codebases like Numpy and PyTorch have worked fine for many years without it.

Numpy isn't just a library, it's extended syntax for the language itself to specify how to do optimized operations on n-dimensional arrays. It takes a while to learn to read and write it.

It's been said that even the core developers only understand a small fraction of the full Python language and ecosystem. If more core people understand how complicated Python already is, they would have less inclination to keep adding more.

Another example is the multi-threaded support. There are a number of choices and I don't know if any one person can keep all of them in their head at once.

IMO, it's a no-brainer to remove the ":=" given the benefits versus costs, but removing the excess complexity around multi-threading is much harder. I personally like just using threadpools which release the GIL when blocking, and running pools of Python processes to take full advantage of multiple processors. With that, the GIL running conventional code is not a problem. However, other people have different use cases, so it's a challenge.

8:49 PM

Blogger smitty1e said...

I submit, with zero support, that the need to keep adding stuff to the language has to do with keeping the training and documentation ecosystems alive.

9:18 PM

Blogger Unknown said...

Since type annotations will henceforth always be treated as strings, not parsed, it seems like we don't actually need list and dict types to be subscriptable anymore? Can't the typing system just parse "list[x, y, z]" as a string without evaluating it?

9:24 PM

Blogger laike9m said...

I'm wondering, why doesn't Python raise a compile time error (SyntaxError for example) for `list[1, 2, 3, 4]`?

10:08 PM

Blogger André Roberge said...

@laike9m This is a valid syntax for type annotation. See PEP 585 https://www.python.org/dev/peps/pep-0585/

10:14 PM

Blogger laike9m said...

Sorry, I should have been more clear. I know the change in 585, but I thought Python could (theoretically) detect this wrong usage (not putting types, but 1, 2, 3, 4 in the generics)

10:17 PM

Blogger Rho said...

i'm guessing in few years they will refactor the language again like 2 vs 3. Although i would like to see fstring with ` symbol like in javascript.

4:45 AM

Spammers: none shall pass.
You can use some HTML tags, such as <b>, <i>, <a>

Comments on this blog are restricted to team members.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot