In [1]:
import math
In [2]:
math.pow?
In [3]:
math.pow(2, 10)
Out[3]:
In [4]:
class Numero(object):
def __init__(self, x):
self.numero = x
def __add__(self, other):
return self.numero + other
In [5]:
n = Numero(4)
In [6]:
n + 5
Out[6]:
In [7]:
class Pessoa(object):
def __init__(self, nome):
self.nome = nome
def __call__(self):
print(self.nome)
In [8]:
p = Pessoa('Gileno')
In [9]:
p.nome
Out[9]:
In [10]:
p()
In [11]:
class View(object):
def __call__(self, request):
pass
In [ ]: