blob: d0b153b0cab8adf513f4c311a6888a02c1320b51 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
class Point(tuple):
@staticmethod
def __new__(cls, x, y):
return tuple.__new__(cls, [x, y])
def __init__(self, x, y):
self.x = x
self.y = y
p = Point(1,2)
print p.x, p.y
|