mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
* Lots of small changes related to access.
* Added "access *: ...", made access work for class methods. * Introduced subclass check: make sure that when calling ClassName.methodname(instance, ...), the instance is an instance of ClassName or of a subclass thereof (this might break some old code!)
This commit is contained in:
parent
81daa32c15
commit
b3f7258f14
7 changed files with 112 additions and 49 deletions
|
@ -100,7 +100,7 @@ return_stmt: 'return' [testlist]
|
|||
raise_stmt: 'raise' test [',' test]
|
||||
import_stmt: 'import' NAME (',' NAME)* | 'from' NAME 'import' ('*' | NAME (',' NAME)*)
|
||||
global_stmt: 'global' NAME (',' NAME)*
|
||||
access_stmt: 'access' NAME (',' NAME)* ':' accesstype (',' accesstype)*
|
||||
access_stmt: 'access' ('*' | NAME (',' NAME)*) ':' accesstype (',' accesstype)*
|
||||
accesstype: NAME+
|
||||
# accesstype should be ('public' | 'protected' | 'private') ['read'] ['write']
|
||||
# but can't be because that would create undesirable reserved words!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue