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 "__" do
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 Protec
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 isin
> 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
>
>
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__
Maybe is just a writers' "play" and nothing else.
--
http://mail.python.org/mailman/listinfo/python-list
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 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
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 = ~