Advertisement
Guest User

Untitled

a guest
Feb 6th, 2019
519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. class A:
  2.     # a = A(x=2); a.f(10)
  3.     def __init__(self, x: int):
  4.         self.x = x
  5.     def __call__(self, y: int):
  6.         print("%s called with y==%d" % (self, y))
  7.         return self.x + y
  8.     def f(self, z: int):
  9.         return self(y=z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement