-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove overlapping slots and fix broken slots inheritance #6547
Conversation
Would be great if you could add this test to the linter step in CI. Then we can avoid introducing new overlaps in future. |
@Dreamsorcerer You mean in - name: Run linters
run: |
make mypy
make slotscheck # after adding slotscheck to Makefile Alternatively I can add the hook to the |
That looks fine to me. Not sure it needs to go in the Makefile. But, I'd make it a separate step (and probably rename that existing step to 'Run Mypy'). I meant lint job earlier, rather than linter step.. |
Can do. I'm curious though: what's the reasoning behind what goes in pre-commit vs GitHub workflow? |
Codecov Report
@@ Coverage Diff @@
## master #6547 +/- ##
=======================================
Coverage 93.36% 93.36%
=======================================
Files 104 104
Lines 30506 30509 +3
Branches 3068 3069 +1
=======================================
+ Hits 28482 28485 +3
Misses 1850 1850
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Probably a question for someone else. I'd assume that pre-commit is being run as a git hook, so it makes sense to have primarily fast checks which are likely to catch mistakes. If it only catches an error for 1 in 500 PRs or something, it's probably best not delaying a developer's commit. But, not sure if that's what has been done so far, I didn't set up anything in pre-commit and don't really mind which way it goes in. |
Indeed, problems with slots probably won't occur in most PRs. I'll add it to the GH workflow for now. |
Thanks! |
What do these changes do?
There were a few
__slots__
related mistakes:Fixing the second error was more problematic than it seems. The straightforward solution of adding
__slots__ = ('_cookies', )
was not possible, because this triggered aTypeError: multiple bases have instance lay-out conflict
inHTTPException
since non-emptly slots cannot be combined with anException
case class:There are several possible solutions:
CookieMixin
, since it's an abstract class. This is the currently implemented solution.__slots__
inStreamResponse
will be mostly ineffective.__slots__
fromStreamResponse
. They aren't saving memory or preventing__dict__
from being created.Are there changes in behavior for the user?
StreamResponse
will no longer have a__dict__
, so arbitrary attributes cannot be set. This is not documented, so likely not a problemRelated issue number
No issue. This is a small change.
Checklist
Unit tests for the changes existn/a (see questions below)Documentation reflects the changesn/aCONTRIBUTORS.txt
CHANGES
folder<issue_id>.<type>
for example (588.bugfix)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.Questions