K
king kikapu
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 ??
Thanks for any help!
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 ??
Thanks for any help!