Hi all
I have started experimenting with properties.
The example in the 2.5 docs uses an inconsistent mixture of single and
double underscores for the internal representation of the attribute. I
was going to file a documentation bug, but then I checked the 2.6 docs
online, and I see it has been
Frank Millman wrote:
I thought that the main point of using property was to prevent direct
access to the attribute.
Not prevent access to as much as add behaviour to.
Is this a valid comment, or does it come under the category of 'we are
all adults here'?
The latter. And the __ doesn't
king kikapu wrote:
On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def
king kikapu wrote:
On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
On Aug 10, 1:33 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert
On Aug 10, 12:21 pm, king kikapu [EMAIL PROTECTED] wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), 'x must be an integer!'
self.__x = ~x
def
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), 'x must be an integer!'
self.__x = ~x
def get_x(self):
return ~self.__x
x = property(get_x)
On Fri, 10 Aug 2007 03:21:29 -0700, king kikapu wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), 'x must be an integer!'
self.__x = ~x
def
On Aug 10, 5:31 am, [EMAIL PROTECTED] wrote:
On Aug 10, 12:21 pm, king kikapu [EMAIL PROTECTED] wrote:
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), 'x
Hi,
i read in a book the following code snippet that is dealing with
properties:
class ProtectAndHideX(object):
def __init__(self, x):
assert isinstance(x, int), 'x must be an integer!'
self.__x = ~x
def get_x(self):
return ~self.__x
x =
Maybe is just a writers' play and nothing else.
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo