Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Backward compatibility & Design considerations sections #20

Merged
merged 4 commits into from
Feb 8, 2021

Conversation

iritkatriel
Copy link
Member

No description provided.

@iritkatriel
Copy link
Member Author

This PR has two commits - a small one to edit "backward compatibility" section. The paragraph I removed is now copied to #19, pending decision about whether to include asyncio integation in this PEP.

The second commit is larger - it rewrites the "design considerations" section (why we did X instead of Y) as "rejected ideas" (why did we reject Y and do X instead).

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder whether we need to say more about backwards compatibility. E.g. if someone has code that uses except Exception: and some library starts wrapping its exceptions in ExceptionGroup, that won't be caught. While that's really the library that's being backwards incompatible, I think we should call that out.

@iritkatriel
Copy link
Member Author

I do wonder whether we need to say more about backwards compatibility. E.g. if someone has code that uses except Exception: and some library starts wrapping its exceptions in ExceptionGroup, that won't be caught. While that's really the library that's being backwards incompatible, I think we should call that out.

Good point, let me put that bit back.

except_star.md Outdated
Comment on lines 850 to 852
* Libraries that need to support older python versions will not be able to use
`except*`, and may need to handle `ExceptionGroup`s raised in user code through
the low-low_level `ExceptionGroup` APIs.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's stronger. They may not raise ExceptionGroup.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what @1st1 meant with this was that you can:

try:
    userCode()
except BaseException as e:
    if python_version >= 3.11:
           if it's an exception group: do stuff to it
    do whatever else

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise what is there to say? "if you need to support older python versions then you can't use the new features" ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I didn't notice this bullet is specifically about older Python versions.

And when I think about the case I was concerned about more, that is just about calling out that raising ExceptionGroup from a library API may break applications that use that API and should thus be considered a new feature of the library. So I think we're good.

@iritkatriel iritkatriel merged commit ef91921 into master Feb 8, 2021
@iritkatriel iritkatriel deleted the design-considerations branch February 8, 2021 00:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.