Python Built-in Functions - callable and __call__()

preview_player
Показать описание
How does the built-in function callable() work and how to make your class instances callable by implementing the __call__() method.

How to develop better habits and write better code?
-- Read more code
-- Write more code
-- Make your code public
-- Be active on Stackoverflow

Read the full article at:

~~~
🐍 Cheating in Python? Of course! 🐍
Become a better coder! Download the 5x Python Cheat Sheet Course (PDF). It’s free!
See you soon -- it’s fun! 🤓
~~~

Experts in their fields read more books! 📚

Each book improves your skills 44% faster (compared to normal Python books) because of our unique puzzle-based learning system.
~~~

Start earning money by creating your own Python coding business (free webinar):

Python Freelancer Course (Six-Figures):
Рекомендации по теме
Комментарии
Автор

Clear video. But what are the use cases? In what situations would you want to make an object callable? Wouldn't it make more sense to just make a separate method/property?

Tntpker