{"id":18463,"date":"2021-11-27T14:08:44","date_gmt":"2021-11-27T08:38:44","guid":{"rendered":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/?p=18463"},"modified":"2021-11-27T14:08:47","modified_gmt":"2021-11-27T08:38:47","slug":"python-callable","status":"publish","type":"post","link":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/","title":{"rendered":"4 Examples to Master Python Callable Function"},"content":{"rendered":"\n<p>So, today in this article, we will focus on <strong>python callable<\/strong>. We will see what python callable means and how can we use it? If you are entirely unaware of the topic, then by the end of this article, you will learn something new by the end of this article. So, let&#8217;s get started.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #990303;color:#990303\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #990303;color:#990303\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Python_Callable_Function\" title=\"Python Callable() Function\">Python Callable() Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Syntax\" title=\"Syntax\">Syntax<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Example_1_-_Callable_Classes\" title=\"Example 1:- Callable Classes\">Example 1:- Callable Classes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Example_2_-_Callable_Function\" title=\"Example 2:- Callable Function\">Example 2:- Callable Function<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Python_make_class_Callable\" title=\"Python make class Callable\">Python make class Callable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Example_3_-_Calling_a_non-callable_object\" title=\"Example 3:- Calling a non-callable object\">Example 3:- Calling a non-callable object<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Example_4_-_Calling_a_Callable_Object\" title=\"Example 4:- Calling a Callable Object\">Example 4:- Calling a Callable Object<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#FAQs\" title=\"FAQs\">FAQs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#Trending_Python_Articles\" title=\"Trending Python Articles\">Trending Python Articles<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-python-callable-function\"><span class=\"ez-toc-section\" id=\"Python_Callable_Function\"><\/span>Python Callable() Function<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So, first, see<strong> what is callable<\/strong>? Yeah, it is simple. Anything which can be called is known as callable. Now the question arises, how does it relate to the python programming language. <\/p>\n\n\n\n<p>So, if you consider a class, then you can say that whenever there is a need for instantiating a class, we need to call the class following the parenthesis. The need for using the parenthesis is to specify that the given class is called, and we have to instantiate an object for it. So, here, we can say that the given class is callable. Now, this goes true for all the classes, whether it is user-defined or inbuilt.<\/p>\n\n\n\n<p>Now the thing that matters to us is that how can we check whether a class or object or a function is callable or not? To do that python callable() function helps us. This function takes the variable as the argument and returns True\/False. Now, before moving to the examples, first, see the syntax of the given function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-syntax\"><span class=\"ez-toc-section\" id=\"Syntax\"><\/span>Syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">callable(&lt;variable>)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-1-callable-classes\"><span class=\"ez-toc-section\" id=\"Example_1_-_Callable_Classes\"><\/span>Example 1:- Callable Classes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Example of Callable Class\n\nclass MyClass:\n  a = 5\n\n# Checking weather the class is callable or not\nprint(callable(MyClass))\nmy_object = MyClass()    # Calling class to instantiate it's object\nprint(my_object.a)\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>True\n5<\/code><\/pre>\n\n\n\n<p>Similarly, if you consider a <strong>function<\/strong> or <strong>class method(),<\/strong> then once you define the function, you can call it when needed, and it will do its work. Here, we can also say that functions are callable. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-2-callable-function\"><span class=\"ez-toc-section\" id=\"Example_2_-_Callable_Function\"><\/span>Example 2:- Callable Function<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Example of Callable Function\n\ndef my_function():\n  print(&quot;This is a callable function&quot;)\n\n# Checking weather the function is callable or not\nprint(callable(my_function))\nmy_function()   # Calling the function\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>True\nThis is a callable function<\/code><\/pre>\n\n\n<div class=\"monsterinsights-inline-popular-posts monsterinsights-inline-popular-posts-kilo monsterinsights-popular-posts-styled\" ><div class=\"monsterinsights-inline-popular-posts-text\"><span class=\"monsterinsights-inline-popular-posts-label\" >Popular now<\/span><span class=\"monsterinsights-inline-popular-posts-border\" ><\/span><span class=\"monsterinsights-inline-popular-posts-border-2\" ><\/span><div class=\"monsterinsights-inline-popular-posts-post\"><a class=\"monsterinsights-inline-popular-posts-title\"  href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\">[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/a><\/div><\/div><\/div><p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-python-make-class-callable\"><span class=\"ez-toc-section\" id=\"Python_make_class_Callable\"><\/span>Python make class Callable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>So far, so good. I hope both things are known to you. What is more captivating here is that you can also call the object of the class (if mentioned there explicitly). What does that mean? It means that one needs to mention the block of code that handles what happens when an object is called. If it&#8217;s mentioned there, then we can say that object of that class is callable. <\/p>\n\n\n\n<p>Now, the question arises how we can do it? To do that, we need to define the <strong>__call__ method<\/strong> in the class whose object we want is to be callable. Let&#8217;s take an example to understand it more clearly.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-3-calling-a-non-callable-object\"><span class=\"ez-toc-section\" id=\"Example_3_-_Calling_a_non-callable_object\"><\/span>Example 3:- Calling a non-callable object<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Example of a non-callable object\n\nclass MyClass:\n  a = 5\n\nmy_object = MyClass()    # Calling class to instantiate it's object\n\n# Checking whether the object is callable or not\nprint(callable(my_object))\nc = my_object()          # To check the error\n\n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>False\n---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n&lt;ipython-input-3-edd45e6a69a3> in &lt;module>()\n      8 # Checking whether the object is callable or not\n      9 print(callable(my_object))\n---> 10 c = my_object()          # To check whether it is callable or not\n\nTypeError: 'MyClass' object is not callable<\/code><\/pre>\n\n\n\n<p class=\"has-base-background-color has-background\"><strong>Recommended Reading | <a href=\"https:\/\/www.pythonpool.com\/numpy-ndarray-object-is-not-callable-error-and-resolution\/\" rel=\"noreferrer noopener\" target=\"_blank\"><span style=\"text-decoration: underline;\">NumPy.ndarray object is Not Callable: Error and Resolution<\/span><\/a><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-example-4-calling-a-callable-object\"><span class=\"ez-toc-section\" id=\"Example_4_-_Calling_a_Callable_Object\"><\/span>Example 4:- Calling a Callable Object<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Example of a callable object\n\nclass MyClass:\n  def __call__(self):\n    print('This function is called under call method')\n\nmy_object = MyClass()    # Calling class to instantiate it's object\n\n# Checking whether the object is callable or not\nprint(callable(my_object))\nc = my_object()          \n<\/pre><\/div>\n\n\n<p><strong>Output:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>This function is called under call method<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-faqs\"><span class=\"ez-toc-section\" id=\"FAQs\"><\/span>FAQs<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1637987288104\"><strong class=\"schema-faq-question\">Is python callable a built-in function?<\/strong> <p class=\"schema-faq-answer\">Yes, it is in-built in python. The function returns True if the method or class is callable. Otherwise False.<\/p> <\/div> <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>So, today in this article, we learned about python callables. We understood the meaning of callable classes, functions, and objects. We saw how an error is raised when a non-callable object is called, and then we saw how we could make an object callable.<\/p>\n\n\n\n<p>I hope this article has helped you. Thank You<\/p>\n\n\n<div class=\"monsterinsights-widget-popular-posts monsterinsights-widget-popular-posts-delta monsterinsights-popular-posts-styled monsterinsights-widget-popular-posts-columns-2\"><h2 class=\"monsterinsights-widget-popular-posts-widget-title\"><span class=\"ez-toc-section\" id=\"Trending_Python_Articles\"><\/span>Trending Python Articles<span class=\"ez-toc-section-end\"><\/span><\/h2><ul class=\"monsterinsights-widget-popular-posts-list\"><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-cant-compare-datetime-datetime-to-datetime-date\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/typeerror-cant-compare-datetime.datetime-to-datetime.date_.webp 1200w \" alt=\"[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] typeerror can&#8217;t compare datetime.datetime to datetime.date<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 11, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-nameerror-name-unicode-is-not-defined\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-nameerror-name-Unicode-is-not-defined.webp 1200w \" alt=\"[Fixed] nameerror: name Unicode is not defined\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] nameerror: name Unicode is not defined<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/solved-runtimeerror-cuda-error-invalid-device-ordinal\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Solved-runtimeerror-cuda-error-invalid-device-ordinal.webp 1200w \" alt=\"[Solved] runtimeerror: cuda error: invalid device ordinal\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Solved] runtimeerror: cuda error: invalid device ordinal<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><li ><a href=\"https:\/\/www.pythonpool.com\/fixed-typeerror-type-numpy-ndarray-doesnt-define-__round__-method\/\"><div class=\"monsterinsights-widget-popular-posts-image\"><img decoding=\"async\" src=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-300x157.webp\" srcset=\" https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-300x157.webp 300w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-1024x536.webp 1024w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method-768x402.webp 768w, https:\/\/www.pythonpool.com\/wp-content\/uploads\/2024\/01\/Fixed-typeerror-type-numpy.ndarray-doesnt-define-__round__-method.webp 1200w \" alt=\"[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method\" \/><\/div><div class=\"monsterinsights-widget-popular-posts-text\"><span class=\"monsterinsights-widget-popular-posts-title\" >[Fixed] typeerror: type numpy.ndarray doesn&#8217;t define __round__ method<\/span><div class=\"monsterinsights-widget-popular-posts-meta\" ><span class=\"monsterinsights-widget-popular-posts-author\">by Namrata Gulati<\/span><span>&#9679;<\/span><span class=\"monsterinsights-widget-popular-posts-date\">January 2, 2024<\/span><\/div><\/div><\/a><\/li><\/ul><\/div><p><\/p>","protected":false},"excerpt":{"rendered":"<p>So, today in this article, we will focus on python callable. We will see what python callable means and how can we use it? If &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"4 Examples to Master Python Callable Function\" class=\"read-more button\" href=\"https:\/\/www.pythonpool.com\/python-callable\/#more-18463\" aria-label=\"More on 4 Examples to Master Python Callable Function\">Read more<\/a><\/p>\n","protected":false},"author":25,"featured_media":18520,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[15],"tags":[4552,4550,4551,4553],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.1 (Yoast SEO v22.4) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>4 Examples to Master Python Callable Function - Python Pool<\/title>\n<meta name=\"description\" content=\"In this article we are going to talk about python callable. We will see what are callables and then callables classes, functions and objects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pythonpool.com\/python-callable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"4 Examples to Master Python Callable Function\" \/>\n<meta property=\"og:description\" content=\"So, today in this article, we will focus on python callable. We will see what python callable means and how can we use it? If you are entirely unaware of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pythonpool.com\/python-callable\/\" \/>\n<meta property=\"og:site_name\" content=\"Python Pool\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-27T08:38:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-27T08:38:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Rishav Raj\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:site\" content=\"@pythonpool\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rishav Raj\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/\"},\"author\":{\"name\":\"Rishav Raj\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/025222e28182ecbb97e17f9f1bf15ac4\"},\"headline\":\"4 Examples to Master Python Callable Function\",\"datePublished\":\"2021-11-27T08:38:44+00:00\",\"dateModified\":\"2021-11-27T08:38:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/\"},\"wordCount\":498,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp\",\"keywords\":[\"python int object is not callable\",\"python list object is not callable\",\"python module object is not callable\",\"python typing callable\"],\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.pythonpool.com\/python-callable\/#respond\"]}]},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/\",\"url\":\"https:\/\/www.pythonpool.com\/python-callable\/\",\"name\":\"4 Examples to Master Python Callable Function - Python Pool\",\"isPartOf\":{\"@id\":\"https:\/\/www.pythonpool.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp\",\"datePublished\":\"2021-11-27T08:38:44+00:00\",\"dateModified\":\"2021-11-27T08:38:47+00:00\",\"description\":\"In this article we are going to talk about python callable. We will see what are callables and then callables classes, functions and objects.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#breadcrumb\"},\"mainEntity\":[{\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104\"}],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pythonpool.com\/python-callable\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#primaryimage\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp\",\"width\":1200,\"height\":628,\"caption\":\"Python Callable\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pythonpool.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"4 Examples to Master Python Callable Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pythonpool.com\/#website\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"name\":\"Python Pool\",\"description\":\"Your One-Stop Python Learning Destination\",\"publisher\":{\"@id\":\"https:\/\/www.pythonpool.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pythonpool.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pythonpool.com\/#organization\",\"name\":\"Python Pool\",\"url\":\"https:\/\/www.pythonpool.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"contentUrl\":\"https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png\",\"width\":452,\"height\":185,\"caption\":\"Python Pool\"},\"image\":{\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/twitter.com\/pythonpool\",\"https:\/\/www.youtube.com\/c\/pythonpool\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/025222e28182ecbb97e17f9f1bf15ac4\",\"name\":\"Rishav Raj\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/23ea47a45532b57ae2a81f274f5ae257?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/23ea47a45532b57ae2a81f274f5ae257?s=96&d=wavatar&r=g\",\"caption\":\"Rishav Raj\"}},{\"@type\":\"Question\",\"@id\":\"https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104\",\"position\":1,\"url\":\"https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104\",\"name\":\"Is python callable a built-in function?\",\"answerCount\":1,\"acceptedAnswer\":{\"@type\":\"Answer\",\"text\":\"Yes, it is in-built in python. The function returns True if the method or class is callable. Otherwise False.\",\"inLanguage\":\"en-US\"},\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"4 Examples to Master Python Callable Function - Python Pool","description":"In this article we are going to talk about python callable. We will see what are callables and then callables classes, functions and objects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/","og_locale":"en_US","og_type":"article","og_title":"4 Examples to Master Python Callable Function","og_description":"So, today in this article, we will focus on python callable. We will see what python callable means and how can we use it? If you are entirely unaware of","og_url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/","og_site_name":"Python Pool","article_published_time":"2021-11-27T08:38:44+00:00","article_modified_time":"2021-11-27T08:38:47+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp","type":"image\/webp"}],"author":"Rishav Raj","twitter_card":"summary_large_image","twitter_creator":"@pythonpool","twitter_site":"@pythonpool","twitter_misc":{"Written by":"Rishav Raj","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#article","isPartOf":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/"},"author":{"name":"Rishav Raj","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#\/schema\/person\/025222e28182ecbb97e17f9f1bf15ac4"},"headline":"4 Examples to Master Python Callable Function","datePublished":"2021-11-27T08:38:44+00:00","dateModified":"2021-11-27T08:38:47+00:00","mainEntityOfPage":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/"},"wordCount":498,"commentCount":0,"publisher":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#organization"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#primaryimage"},"thumbnailUrl":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp","keywords":["python int object is not callable","python list object is not callable","python module object is not callable","python typing callable"],"articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#respond"]}]},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/","name":"4 Examples to Master Python Callable Function - Python Pool","isPartOf":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#primaryimage"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#primaryimage"},"thumbnailUrl":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp","datePublished":"2021-11-27T08:38:44+00:00","dateModified":"2021-11-27T08:38:47+00:00","description":"In this article we are going to talk about python callable. We will see what are callables and then callables classes, functions and objects.","breadcrumb":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#breadcrumb"},"mainEntity":[{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104"}],"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#primaryimage","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp","contentUrl":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2021\/11\/Python-Callable.webp","width":1200,"height":628,"caption":"Python Callable"},{"@type":"BreadcrumbList","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/"},{"@type":"ListItem","position":2,"name":"4 Examples to Master Python Callable Function"}]},{"@type":"WebSite","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#website","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/","name":"Python Pool","description":"Your One-Stop Python Learning Destination","publisher":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#organization","name":"Python Pool","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","contentUrl":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-content\/uploads\/2020\/08\/aa.png","width":452,"height":185,"caption":"Python Pool"},"image":{"@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/twitter.com\/pythonpool","https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.youtube.com\/c\/pythonpool"]},{"@type":"Person","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#\/schema\/person\/025222e28182ecbb97e17f9f1bf15ac4","name":"Rishav Raj","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/#\/schema\/person\/image\/","url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/secure.gravatar.com\/avatar\/23ea47a45532b57ae2a81f274f5ae257?s=96&d=wavatar&r=g","contentUrl":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/secure.gravatar.com\/avatar\/23ea47a45532b57ae2a81f274f5ae257?s=96&d=wavatar&r=g","caption":"Rishav Raj"}},{"@type":"Question","@id":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104","position":1,"url":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/python-callable\/#faq-question-1637987288104","name":"Is python callable a built-in function?","answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Yes, it is in-built in python. The function returns True if the method or class is callable. Otherwise False.","inLanguage":"en-US"},"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/18463"}],"collection":[{"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/comments?post=18463"}],"version-history":[{"count":15,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/18463\/revisions"}],"predecessor-version":[{"id":18526,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/posts\/18463\/revisions\/18526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media\/18520"}],"wp:attachment":[{"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/media?parent=18463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/categories?post=18463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/www.pythonpool.com\/wp-json\/wp\/v2\/tags?post=18463"}],"curies":[{"name":"wp","href":"https:\/\/web.archive.org\/web\/20240926040232\/https:\/\/api.w.org\/{rel}","templated":true}]}}