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
Add __slots__
to AsyncResource
#733
Conversation
Do you have a use case for this? None of the subclasses in AnyIO itself use |
I'm creating my own child classes of |
Attrs doesn't require the superclasses to have
|
You forgot to subclass From https://threeofwands.com/attrs-ii-slots/ (which is a really good write-up on slotted classes btw):
|
Right, I forgot to do that. It seems that |
I haven't been using
I'm -0 on this. If someone wanted a weak referenceable- |
Alright, you convinced me. |
Changes
AsyncResource
should have__slots__
so child classes can use__slots__
.Similar to python/cpython#105726 and python/cpython#106771 for
contextlib.AbstractAsyncContextManager
.Checklist
If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or newfeatures)
docs/versionhistory.rst
).