PrePEP: Class-level private property isolation
Discussions on Python.org
PrePEP: Class-level private property isolation
This proposal is the abridgment of private_attribute_cpp: Abstract Python now use name-magging on the name with pre-double underline to create the namespace for this class. However, when two classes have same name (or the difference is just the number of prefer underline), if they appear in one inheritance chain, there will be still conflict. You can use these codes to reqppear this problem: # module1.py class _Helper: def __init__(self): self.__value = 1 def get_something(self...
0 comments
No comments yet.