How do you call a class function in Python?

The __call__ method enables Python programmers to write classes where the instances behave like functions and can be called like a function. When the instance is called as a function; if this method is defined, x(arg1, arg2, …) is a shorthand for x.

Sizin İçin Seçtik  Yazılım öğrenmek için nereden başlamalı?

Leave a Reply

Your email address will not be published. Required fields are marked *