Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Except clause #81824

Closed
ghost opened this issue Jul 21, 2019 · 3 comments
Closed

Except clause #81824

ghost opened this issue Jul 21, 2019 · 3 comments
Labels
3.9 only security fixes type-feature A feature request or enhancement

Comments

@ghost
Copy link

ghost commented Jul 21, 2019

BPO 37643
Nosy @ericvsmith, @tirkarthi

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2019-07-21.14:55:21.451>
created_at = <Date 2019-07-21.12:07:04.389>
labels = ['type-feature', '3.9']
title = 'Except clause'
updated_at = <Date 2019-07-21.14:55:21.438>
user = None

bugs.python.org fields:

activity = <Date 2019-07-21.14:55:21.438>
actor = 'eric.smith'
assignee = 'none'
closed = True
closed_date = <Date 2019-07-21.14:55:21.451>
closer = 'eric.smith'
components = []
creation = <Date 2019-07-21.12:07:04.389>
creator = '\xd0\x90\xd1\x80\xd1\x82\xd1\x83\xd1\x80 \xd0\x93\xd1\x80\xd0\xb8\xd0\xb3\xd0\xbe\xd1\x80\xd1\x8c\xd0\xb5\xd0\xb2'
dependencies = []
files = []
hgrepos = []
issue_num = 37643
keywords = []
message_count = 3.0
messages = ['348238', '348243', '348248']
nosy_count = 3.0
nosy_names = ['eric.smith', 'xtreak', '\xd0\x90\xd1\x80\xd1\x82\xd1\x83\xd1\x80 \xd0\x93\xd1\x80\xd0\xb8\xd0\xb3\xd0\xbe\xd1\x80\xd1\x8c\xd0\xb5\xd0\xb2']
pr_nums = []
priority = 'normal'
resolution = 'postponed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue37643'
versions = ['Python 3.9']

@ghost
Copy link
Author

ghost commented Jul 21, 2019

Is is possible to add to Python the following syntax (keyword 'except'):
[1, 2, 3, 4, 5] except [2]
>>> [1, 3, 4, 5]

Repository owner added 3.9 only security fixes type-feature A feature request or enhancement labels Jul 21, 2019
@tirkarthi
Copy link
Member

I guess you are popping 2 from the list and using except for the same. New syntax and semantics needs to be discussed in python-ideas mailing list. Though this reads like English except is used for exception based semantics. I would propose closing this and reopen if it's agreed by core devs in the mailing list.

@ericvsmith
Copy link
Member

Yes, this should be discussed on python-ideas first, so I'm closing it here.

But to be honest with you, there's really no chance this would get accepted. It's just too easy to do it with existing list comprehension syntax, which is much more general purpose.

>>> [v for v in [1, 2, 3, 4, 5] if not v in [2]]
[1, 3, 4, 5]

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants