Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #13411. The error for subclassing bool is now due to it being typed as final rather than a specific check.
This means
class A(bool): ...
giveserror: Cannot inherit from final class "bool"
instead oferror: "bool" is not a valid base class
and is now ignorable with# type: ignore
.Writing this and playing around with it a bit more made me realise my original use case in the issue was a bit silly, although I think this change still makes sense. I wont be offended if the maintainers disagree and decide to close this though 馃槃
Test Plan
I fixed the semantic analyser test as it shouldn't do anything about extending bool now.
I didn't add a new test as I couldn't work out exactly what stubs I needed to include/change to get a bool that's typed as final. I'm also not entirely sure they're necessary, since all the test would be adding is a check that bool is marked as final, which just depends on typeshed. If you would like tests for this i'd be happy to add them with some guidance on how.