-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Final names and attributes #5522
Merged
Merged
Changes from all commits
Commits
Show all changes
58 commits
Select commit
Hold shift + click to select a range
c6125f1
Start adding tests
8f2bee6
Add some flags
61707ab
Add semanal logic for (not really) variables
75ccad3
Add checks for re-assignment; self and other fixes; work on tests
84ac046
Tests for invalid declarations
395cbd5
Move the logic for MemberExpr to checkmember.py; more tests
67c76bf
Implement special access on class objects
f6b173e
Fix class re-assignment; more tests
5053902
Create new Var with bare Final on self; search all bases for final; t…
8a4ed37
Multiple inheritance; fix lint
c6a2d99
Start writing docs
0ca2770
Final classes and methods (+ some tests)
aa3ab4b
Minor fixes; more overriding tests
ad42674
An overload fix; more tests
a106d08
Tweak error messages; move error logic to messages.py
37c4bb6
Add protocol tests
b6531d3
Add some comments and docstrings; some reorg
8366d3f
Add more docs
312cbc7
Minor fixes in docs
ec15a63
Some fine-grained stuff; add diff tests
c8a8d9b
Clarify constant re-export; add few tests
157a936
Add more incremental tests (coarse and fine)
eb945c9
Tweak some targets in fine-grained tests
58e4243
Only keep basic tests in coarse-grained
8602c61
Store final value for simple literals
7e05f7d
Prohibit augmented assignments and final within loops
fa7f8d5
Address CR
ilevkivskyi 8d2973c
Fix alias on newer Python versions
ilevkivskyi 430660e
Merge branch 'master' into final
ilevkivskyi 11a157e
Move final docs to a separate file
b5dca3b
Add section header
1912fd8
Fix the rest of comments about docs
235b28f
Prohibit overriding writeable with final
86e883a
Fix some tests
ilevkivskyi aa8b436
Allow deferred final definition in __init__
ilevkivskyi 95da7ce
Fix self-check
ilevkivskyi b50f3de
Update new Var final flags
ilevkivskyi 2f74d87
Simplify/shorten some error messages
ilevkivskyi f9f1182
Merge remote-tracking branch 'upstream/master' into final
ilevkivskyi 0364868
Further simplify error messages; use one-line errors instead of notes
ilevkivskyi 632def5
Merge remote-tracking branch 'upstream/master' into final
ilevkivskyi cc8ce09
Merge branch 'master' into final
ilevkivskyi 35bf8cf
Merge branch 'master' into final
ilevkivskyi 53720e3
Remove ClassVar discussion
ilevkivskyi 953119d
Update docs
ilevkivskyi ed009ee
Minor fixes in code
ilevkivskyi b8c67aa
Stricter rules for final in overloads; update tests
ilevkivskyi c9abd9d
Minor fixes
ilevkivskyi 41b996f
Address some CR
ilevkivskyi 7a85285
More CR; update tests
ilevkivskyi b37f35f
Prohibit bare final without r.h.s.
ilevkivskyi f521723
Merge remote-tracking branch 'upstream/master' into final
ilevkivskyi 66fdbc8
Minor fixes
ilevkivskyi a76da46
Kill the doc part
ilevkivskyi aefd17c
Add test case for delayed definition in a subclass
309e1a5
Show less errors; add a test
98270fc
Fix self-check
8b52fda
Fix grammar
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
This needs a docstring. Explain what this checks and the return value. It looks like there's subtlety about what this checks which would be good to call out -- it looks like this only checks for some subsets of errors, as other cases are handled elsewhere.