-
-
Notifications
You must be signed in to change notification settings - Fork 379
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
allow __suppress_context__ and __notes__ to be mutated on frozen exceptions #1365
Conversation
@@ -554,6 +556,10 @@ def _frozen_delattrs(self, name): | |||
""" | |||
Attached to frozen classes as __delattr__. | |||
""" | |||
if isinstance(self, BaseException) and name in ("__notes__",): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from pep678 https://peps.python.org/pep-0678/#specification
Libraries may clear existing notes by modifying or deleting the notes list, if it has been created, including clearing all notes with del err.notes. This allows full control over the attached notes, without overly complicating the API or adding multiple names to BaseException.dict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Summary
Pull Request Check List
main
branch – use a separate branch!Our CI fails if coverage is not 100%.
.pyi
).tests/typing_example.py
.attr/__init__.pyi
, they've also been re-imported inattrs/__init__.pyi
.docs/api.rst
by hand.@attr.s()
and@attrs.define()
have to be added by hand too.versionadded
,versionchanged
, ordeprecated
directives.The next version is the second number in the current release + 1.
The first number represents the current year.
So if the current version on PyPI is 22.2.0, the next version is gonna be 22.3.0.
If the next version is the first in the new year, it'll be 23.1.0.
attrs.define()
andattr.s()
, you have to add version directives to both..rst
and.md
files is written using semantic newlines.changelog.d
.