My Authors
Read all threads
Python callable()

In Python, a callable is anything that can be called, using parentheses and maybe with some arguments. Functions, Generators, and Classes are inherently callable in Python.
#Python #CodeNewbie #100DaysOfCode #DataScience #WomenWhoCode
The callable() method takes an object and returns a boolean.

True – if the object is callable
False – if the object is not callable
The callable() method checks if the object is either of the two –

An instance of a class with a __call__ method
Is of a type that has a which indicates callability such as in functions, classes, etc. or has a non-null tp_call (c struct) member.
Since functions are callable in Python.

def my_function():
print("Hi, I'm a function")

callable(my_function)

Output: True

This indicates that every time we create a function, Python creates a callable object for it. You can also verify the presence of __call__ attribute.
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Data Science East Africa🧠

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!