←back to thread

2024 points randlet | 4 comments | | HN request time: 0.668s | source
Show context
sametmax ◴[] No.17516409[source]
It's going to be very interesting to see if things like:

- pattern matching

- inline exception catching

- path inclusion in the built in

- more functional tooling

- lazy keywors

That were BDFL-blocked, will go back to be debated in the mailing list in the next months.

And if yes, will the community stands by its root or create a new era ?

The consequences of which we will only really see in 10 years.

Guido as done an incredible job at being the boogie man, keeping the language simple and readable. It's a hard job.

Can we pull it off ?

replies(4): >>17516765 #>>17518674 #>>17519896 #>>17519907 #
1. stormbeta ◴[] No.17519907[source]
The big one I want to see, because it's one of my biggest frustrations with Python, is to finally make lambdas work like every other contemporary language instead of being inexplicably limited to a single expression simply because Guido couldn't come up with a syntax that agreed with him.

There's so many cases (arguably including the problem this PEP was designed to solve!) where having a real inline closure is just far more readable than having to arbitrarily break every single thing that happens to need 2+ expressions out into named blocks out of sequence.

Other things in Python are either simply a result of the language's age and history, or have real technical pros and cons, but that one irks me because it's an artificial limitation chosen for no reason except aesthetics.

replies(2): >>17521396 #>>17521437 #
2. mijamo ◴[] No.17521396[source]
Nononono

God please NO!

I would KILL not to make that happen. So many devs abuse those in every language that has that. Even lambas get sometimes abused in Python (and I have a few examples in our codebase unfortunately). Expanding lambdas' scope is the LAST thing I want in Python, this would just lead to worst codebases, with nearly 0 benefit.

If you want to do something that needs 2 expressions, just create a goddamn function and name it for god's sake.

Sorry but I had to say it, I think the lambda limitations is one of my favorite feature in Python.

replies(1): >>17522594 #
3. zimablue ◴[] No.17521437[source]
I read a long time ago and was convinced that no nice lambdas was one of the biggest problems in python, but that poster argued convincingly that it's an unavoidable consequence of the meaningful whitespace. Are you proposing a special syntax for multiple statements on one line for this?
4. gugagore ◴[] No.17522594[source]
It's useful to be able to give names to things and it's also useful to not be able to give names to things.

It could and could also not be useful to give names to all the subexpressions in the following

w = a(b(c(x,y),z))

You could impose a limitation on how many function can be in a single expression, forcing you to give names. That's analogous to your favorite feature, no?