Re: Python has a "really hidden encapsulation"?

2010-10-23 Thread dmytro starosud
:-0 very interesting! I've tried to run something like this: . class en_property(property): ptr_pget = None ptr_pset = None def pset(self, _class, value): if (self.ptr_pset is None or type(value) == tuple):

Re: Python has a "really hidden encapsulation"?

2010-10-21 Thread dmytro starosud
Thanks for answer, Attribute accessing inside the class is implemented by getters and setters: "min_set", "min_get", "max_set" and "max_get". You can put your logic to this functions and parameter "prop" is the direct reference to this property. I can create a "really read-only attribute", and oth

Python has a "really hidden encapsulation"?

2010-10-21 Thread dmytro starosud
Hello, I'm Python beginner (from Ukraine). I may have found the way to really hide attributes in Python class. The whole control on this attribute is implemented inside of the class. *(code is below, Python 3) You see that we can't get the reference to instance of class "en_property" outside the cl