Home

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 get_x(self):
> return ~self.__x
>
> x = property(get_x)
>
>
> Can anyone please help me understand what the symbol "~" does here ??

This has nothing to do with properties. For integer objects ``~`` is the
bitwise negation or invertion operator.

Ciao,
Marc 'BlackJack' Rintsch

previous
next

Re: Co-developers wanted: document markup language
Re: Sets in Python
Re: weakrefs and bound methods
Re: unsigned char ---- a special type of integer
love with married woman , hot local sexdates , sex shows , meet hot
paraprotex opinie
fotografia ślubna lublin
andrzej dąbrowski
Buty na zimę 2012
Wróżka