Minor refactors in _threads.py#2871
Conversation
after 5422f61, mypy can't tell that abandon_on_cancel cannot be None here
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2871 +/- ##
==========================================
- Coverage 99.51% 99.51% -0.01%
==========================================
Files 115 115
Lines 17683 17672 -11
Branches 3172 3171 -1
==========================================
- Hits 17598 17587 -11
Misses 56 56
Partials 29 29
|
mypy doesn't let you redefine the variable type. however, you can stick a I'm not sure why it would change if you didn't change the code related though... |
|
I'd rather ignore than assert because
Happy to hear an argument otherwise though! |
|
I don't see why mypy started warning you just now, so that's probably a sign of a mypy bug. As for adding an |
Actually this was the right answer all along, I just needed a new variable to carry along the narrowed type! |
CoolCat467
left a comment
There was a problem hiding this comment.
You are quite right, looking at as one big change is confusing. After going through each commit, this looks great!
A5rocks
left a comment
There was a problem hiding this comment.
One small thing I noticed, looks good other than this.
A5rocks
left a comment
There was a problem hiding this comment.
Sorry about the confusion, looks good.
|
With a second approval, I am going to merge this. |
Since I've been staring at the threading code for a long time now, I've found a couple of changes that are probably good for maintainability and good style, but were not a priority for release. I recommend looking at this PR commit by commit rather than as a whole; I'll try to make sure CI gives a green check for each discrete refactor.