Creation of new identifer

A new idea: “only”

I came up with an idea for a new Python keyword called “only”.

The idea is to check all available values and find the ones that satisfy a condition without having to manually write multiple loops or “if/else” statements.

I know this can already be done in Python, but I thought it would be interesting to explore whether “only” could make this process simpler.

What do you guys think? Is something like this already possible?

Isn’t that what filter does?

Could you give a specific example of some code that works, and the code that you would like to replace it with?
The odds of this being worth a new keyword are extraordinarily low (because the bar is very high), but I’m curious what your proposal specifically is.

Yes it is i forgot it

I am still trying to define the exact behaviour

Moving to the Help category. You’ll want a good understanding of Python, and figure out exactly what you want out of a new feature that’s not already available before proposing an Idea.

i think i would take some time . I was considering to delete the post but i can’t do that please can delete it