Advertisement
awroblewski

Python __call__

Nov 27th, 2022
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.21 KB | Source Code | 0 0
  1. class mojaKlasa:
  2.     def __init__(self):
  3.         print("utworzenie nowej instancji klasy")
  4.  
  5.     def __call__(self, jeden, dwa):
  6.         print("odwolanie do metody __call__")
  7.         print(jeden+dwa)
  8.  
  9. jeden = mojaKlasa()
  10. jeden(1,15)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement