callとは、クラスのインスタンスを関数として扱うことができるものです。
class Print:
def __call__(self, a):
print(a)
b = Print()
b('aiueo')
出力
aiueo
Go to list of users who liked
More than 3 years have passed since last update.
callとは、クラスのインスタンスを関数として扱うことができるものです。
class Print:
def __call__(self, a):
print(a)
b = Print()
b('aiueo')
出力
aiueo
Register as a new user and use Qiita more conveniently
Go to list of users who liked