{"id":4404,"date":"2023-08-03T09:26:28","date_gmt":"2023-08-03T09:26:28","guid":{"rendered":"https:\/\/pickl.ai\/blog\/?p=4404"},"modified":"2025-07-24T13:09:59","modified_gmt":"2025-07-24T07:39:59","slug":"method-overriding-method-overloading-in-python","status":"publish","type":"post","link":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/","title":{"rendered":"Simply Explaining Method Overriding &amp; Method Overloading in Python"},"content":{"rendered":"<p><span style=\"font-weight: 400;\"><strong>Summary:<\/strong> This blog explains method overloading and method overriding in Python, covering their definitions, implementations, and differences. Examples demonstrate how to use default and variable-length arguments for overloading and how subclasses override superclass methods to customise behaviour.<\/span><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of 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: #999;color:#999\" 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: #999;color:#999\" 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 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Introduction\" >Introduction<\/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.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Overloading_In_Python\" >Method Overloading In Python<\/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.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Overloading_In_Python_With_Example\" >Method Overloading In Python With Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#How_do_you_overload_a_method_in_Python\" >How do you overload a method in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Overriding_In_Python\" >Method Overriding In Python<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Overriding_In_Python_With_Example\" >Method Overriding In Python With Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#How_To_Do_Method_Overriding_In_Python\" >How To Do Method Overriding In Python?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Superclass_and_Subclass_Relationship\" >Superclass and Subclass Relationship:<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Definition_in_Superclass\" >Method Definition in Superclass:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Method_Definition_in_Subclass\" >Method Definition in Subclass:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Calling_the_Overridden_Method\" >Calling the Overridden Method:<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Difference_Between_method_overloading_and_method_overriding_in_Python\" >Difference Between method overloading and method overriding in Python\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#What_is_method_overloading_in_Python\" >What is method overloading in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#How_is_method_overriding_implemented_in_Python\" >How is method overriding implemented in Python?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Can_Python_support_method_overloading_natively\" >Can Python support method overloading natively?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 id=\"introduction\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span><strong>Introduction<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Python is a computer programming language for building websites and software, automating tasks, and conducting data analysis. It is one of the most popular and widely used <a href=\"https:\/\/www.pickl.ai\/blog\/programming-languages-list\/\">programming languages<\/a> today. Python has helped create Netflix\u2019s recommendation algorithm and even software for self-driving cars.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">There are two types of methods in OOP: method overloading and method overriding. Method overloading and method overriding in Python are two distinct ideas, and their applications are practical. The following blog will discuss the methods with examples and how they work while providing knowledge on their critical differences.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">As a general-purpose language, Python is specially designed for various applications, including Data Science, software and web development, automation, etc. Accordingly,<\/span><a href=\"https:\/\/pickl.ai\/blog\/category\/python-programming\/\"> <b>Python <\/b><span style=\"font-weight: 400;\">methods<\/span><\/a><span style=\"font-weight: 400;\"> are crucial for Object-Oriented Programming (OOP).\u00a0<\/span><\/p>\n<h2 id=\"method-overloading-in-python\"><span class=\"ez-toc-section\" id=\"Method_Overloading_In_Python\"><\/span><b>Method Overloading In Python<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Method overloading in Python is a concept that allows a class to have multiple methods with the same name but different parameter lists. Unlike other programming languages like Java, Python does not directly support method overloading, where you can define multiple methods with different parameter lists.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, you can achieve method overloading-like behaviour in Python using default or variable-length arguments (*args and **kwargs).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">You can create a method that handles multiple parameter lists by using default arguments and providing default values for some parameters. It allows you to call the method with different numbers of arguments, and it will use the default values for any missing ones.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using variable-length arguments (*args), you can create a method that can accept any number of arguments. It is useful when you want a method to work with a variable number of arguments without explicitly defining them.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Using variable-length keyword arguments (**kwargs), you can create a method accepting keyword arguments. It provides even more flexibility in handling different combinations of parameters.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Method overloading in Python empowers you to create versatile and adaptable methods for various argument scenarios. It significantly promotes code reusability and enhances the flexibility of your classes, making your code more robust and maintainable.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">While Python does not enforce strict method overloading, you can use these flexible argument-handling techniques to achieve similar functionality.<\/span><\/p>\n<h3 id=\"method-overloading-in-python-with-example\"><span class=\"ez-toc-section\" id=\"Method_Overloading_In_Python_With_Example\"><\/span><b>Method Overloading In Python With Example<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Method overloading is a feature in <\/span><a href=\"https:\/\/pickl.ai\/blog\/best-programming-language-for-data-science\/\"><b>programming languages<\/b><\/a><span style=\"font-weight: 400;\"> that allows a class to have multiple methods with the same name but different parameter lists. The technique will depend on the number or type of arguments provided during the function call. Here are some examples of method overloading in Python:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example 1: Overloading methods with different parameter types<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img fetchpriority=\"high\" decoding=\"async\" class=\"radius-5 wp-image-8678 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"640\" height=\"465\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2.png 640w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-300x218.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-110x80.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-200x145.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-380x276.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-255x185.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-550x400.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image2-150x109.png 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example 2: Overloading methods with different parameter types<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img decoding=\"async\" class=\"radius-5 wp-image-8680 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"646\" height=\"346\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4.png 646w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-300x161.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-110x59.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-200x107.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-380x204.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-255x137.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-550x295.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image4-150x80.png 150w\" sizes=\"(max-width: 646px) 100vw, 646px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Note that method overloading is not directly supported in Python, unlike in some other programming languages like Java. In Python, only the last defined method with the same name will be used, and the previous ones will be overridden. Thus, the above examples will not work as intended in Python.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To achieve method overloading-like behavior in Python, you can use default or variable-length arguments (*args, **kwargs) to handle different parameter lists. Here&#8217;s an example using variable-length arguments:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img decoding=\"async\" class=\"radius-5 wp-image-8679 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"651\" height=\"253\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3.png 651w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-300x117.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-110x43.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-200x78.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-380x148.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-255x99.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-550x214.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image3-150x58.png 150w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Remember that method overloading is not a strict requirement in Python, as the language relies on duck typing. It allows functions to accept different types of arguments without explicit method overloading.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">However, using *args and **kwargs can give you more flexibility and achieve results similar to method overloading in other languages.<\/span><\/p>\n<h2 id=\"how-do-you-overload-a-method-in-python\"><span class=\"ez-toc-section\" id=\"How_do_you_overload_a_method_in_Python\"><\/span><b>How do you overload a method in Python?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In Python, method overloading is achieved using default or variable-length arguments (*args, **kwargs) to handle different parameter lists. The idea is to define a single method with a generic name that can accept multiple combinations of arguments.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Then, the appropriate logic inside the method will handle different cases based on the arguments passed. Here&#8217;s how you can overload a method in Python:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example using default arguments:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8682 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"645\" height=\"297\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6.png 645w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-300x138.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-110x51.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-200x92.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-380x175.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-255x117.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-550x253.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image6-150x69.png 150w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example using variable-length arguments:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8681 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"646\" height=\"294\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5.png 646w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-300x137.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-110x50.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-200x91.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-380x173.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-255x116.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-550x250.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image5-150x68.png 150w\" sizes=\"(max-width: 646px) 100vw, 646px\" \/><\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example using variable-length keyword arguments:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8684 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"648\" height=\"394\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8.png 648w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-300x182.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-110x67.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-200x122.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-380x231.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-255x155.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-550x334.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image8-150x91.png 150w\" sizes=\"(max-width: 648px) 100vw, 648px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Using default or variable-length arguments, you can create methods in Python that can handle multiple argument combinations, effectively achieving method overloading-like behaviour.<\/span><\/p>\n<h2 id=\"method-overriding-in-python\"><span class=\"ez-toc-section\" id=\"Method_Overriding_In_Python\"><\/span><b>Method Overriding In Python<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Method overriding is a crucial concept in <\/span><a href=\"https:\/\/en.wikipedia.org\/wiki\/Object-oriented_programming\" rel=\"nofollow\"><span style=\"font-weight: 400;\">Object-Oriented Programming<\/span><\/a><span style=\"font-weight: 400;\"> (OOP). It allows a subclass to provide a specific implementation for a method already defined in its superclass.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In Python, method overriding is achieved by defining a process in the subclass with the same name and number of parameters as the method in the superclass.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When an object of the subclass calls the overridden method, Python uses the implementation from the subclass instead of the one in the superclass. This enables the subclass to customise the method&#8217;s behaviour while preserving the same method signature as the superclass, ensuring a consistent interface across the class hierarchy.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Method overriding promotes code reuse and flexibility in OOP. It allows you to create specialised versions of methods in subclasses, tailoring their functionality to suit the specific needs of each subclass.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This behaviour is essential in building scalable and maintainable applications. It enables you to extend existing classes&#8217; behaviour without modifying their source code. It\u00a0is a powerful tool in Python, facilitating the creation of robust and modular object-oriented systems.<\/span><\/p>\n<h3 id=\"method-overriding-in-python-with-example\"><span class=\"ez-toc-section\" id=\"Method_Overriding_In_Python_With_Example\"><\/span><b>Method Overriding In Python With Example<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Method overriding is a concept in object-oriented programming where a subclass provides a specific implementation for a method already defined in its superclass. This allows the subclass to customise the behaviour of the method while maintaining the same method signature. Here&#8217;s an example of method overriding in Python:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8683 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"640\" height=\"513\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7.png 640w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-300x240.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-110x88.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-200x160.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-380x305.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-255x204.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-550x441.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image7-150x120.png 150w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In this example, we have a superclass Animal with a method make_sound(), which returns a generic sound. The subclasses Dog and Cat extend the Animal class and override the make_sound() method with their specific implementations.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">When we call make_sound() on instances of the subclasses, Python will use the overridden methods defined in the subclass instead of the one in the superclass.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">It&#8217;s essential to note that method overriding is possible when there is an inheritance relationship between classes (i.e., the subclass extends the superclass). If there is no inheritance, method overriding does not occur, and Python will call the method defined in the class where the function overriding in Python call is made.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here&#8217;s an example to demonstrate this:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8687 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"639\" height=\"390\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10.png 639w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-300x183.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-110x67.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-200x122.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-380x232.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-255x156.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-550x336.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image10-150x92.png 150w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In this example, class C extends both classes A and B. When we call foo() on an instance of C, Python will use the foo() method from class A (the first class in the list of base classes). If class C only extended class B, the output would have been &#8220;Class B&#8221;.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Method overriding is a powerful mechanism for customising and extending the behaviour of classes in object-oriented programming. It allows you to provide specialised implementations in subclasses while maintaining a consistent interface through the superclass.<\/span><\/p>\n<h2 id=\"how-to-do-method-overriding-in-python\"><span class=\"ez-toc-section\" id=\"How_To_Do_Method_Overriding_In_Python\"><\/span><b>How To Do Method Overriding In Python?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Method overriding is a concept in Object-Oriented Programming (OOP) where a subclass provides a specific implementation for a method already defined in its superclass. When an object of the subclass calls the overridden method, Python will use the implementation from the subclass instead of the one in the superclass.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Method overriding is based on inheritance, which is one of the critical features of OOP. Inheritance allows a class (subclass) to inherit properties and behaviors from another class (superclass). The subclass can then extend or modify the functionality of the superclass to create a more specialised version of the class.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here&#8217;s a step-by-step explanation of how to override a method in Python:<\/span><b><\/b><\/p>\n<h3 id=\"superclass-and-subclass-relationship\"><span class=\"ez-toc-section\" id=\"Superclass_and_Subclass_Relationship\"><\/span><b>Superclass and Subclass Relationship:<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><span style=\"font-weight: 400;\">In Python, we define classes using the class keyword. The class being inherited is called the superclass (or parent class), and the class inheriting from the superclass is called the subclass (or child class).<\/span><\/li>\n<li><span style=\"font-weight: 400;\">To create a subclass, include the superclass&#8217;s name inside parentheses after the subclass name, like this: class SubclassName(SuperclassName):<br \/>\n<\/span><b><\/b><b><\/b><\/li>\n<\/ul>\n<h4 id=\"method-definition-in-superclass\"><span class=\"ez-toc-section\" id=\"Method_Definition_in_Superclass\"><\/span><b>Method Definition in Superclass:<\/b><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">The superclass contains a method that you want to override in the subclass.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The method in the superclass must have the same name as the method you want to override in the subclass. This is essential for method overriding to work.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The method in the superclass can have any implementation you want to share among its subclasses.<\/span><\/li>\n<\/ul>\n<h4 id=\"method-definition-in-subclass\"><span class=\"ez-toc-section\" id=\"Method_Definition_in_Subclass\"><\/span><b>Method Definition in Subclass:<\/b><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><span style=\"font-weight: 400;\">In the subclass, define a method with the same name and number of parameters as the method you want to override in the superclass.<\/span><\/li>\n<li><span style=\"font-weight: 400;\">The method definition in the subclass will replace the implementation of the method in the superclass. This means when you call the method on an instance of the subclass, Python will use the overridden method from the subclass, not the one from the superclass.<\/span><\/li>\n<\/ul>\n<h4 id=\"calling-the-overridden-method\"><span class=\"ez-toc-section\" id=\"Calling_the_Overridden_Method\"><\/span><b>Calling the Overridden Method:<\/b><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">When you create an instance of the subclass and call the method, Python first looks for the process in the subclass.<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">If Python finds the method in the subclass, it executes the overridden method from the subclass.<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">If Python does not find the method in the subclass, it looks for the method in the superclass and executes it.<\/span><\/li>\n<\/ul>\n<p><b>Here&#8217;s an example of method overriding:<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"radius-5 wp-image-8686 size-full alignnone\" src=\"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9.png\" alt=\"Method Overriding &amp; Method Overloading in Python\" width=\"645\" height=\"526\" srcset=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9.png 645w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-300x245.png 300w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-110x90.png 110w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-200x163.png 200w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-380x310.png 380w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-255x208.png 255w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-550x449.png 550w, https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/image9-150x122.png 150w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">In this example, Animal is the superclass, and Dog and Cat are subclasses. Both Dog and Cat override the make_sound() method defined in the Animal class with their specific implementations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Method overriding allows you to create more specialised and flexible classes in your code. It promotes code reuse, as you can define common behaviours in the superclass and customise them in the subclasses. This is one of the powerful tools in OOP that enables you to build complex and scalable applications in Python.<\/span><\/p>\n<h2 id=\"difference-between-method-overloading-and-method-overriding-in-python\"><span class=\"ez-toc-section\" id=\"Difference_Between_method_overloading_and_method_overriding_in_Python\"><\/span><b>Difference Between method overloading and method overriding in Python\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The table below demonstrates method overloading vs method overriding in Python. Accordingly, the differences between Python overloading and overriding are as follows:\u00a0<\/span><\/p>\n<table class=\"table-bordered\">\n<tbody>\n<tr>\n<td><b>Method Overloading\u00a0<\/b><\/td>\n<td><b>Method Overriding\u00a0<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">It refers to defining multiple methods with the same name but different parameters.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It defines the method in a subclass that has the same name as one of its superclasses.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">The use of default arguments can help in achieving method overloading.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It can be achieved by defining the method in a subclass with the same name as one of its superclasses.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">Based on the input parameters, it allows a class to have multiple methods with the same name but different behaviours.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It will enable a subclass to provide its implementation of a method defined in the superclass.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">The method choice is determined during the compile time based on the number and types of arguments passed to the method.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The choice of calling a method is determined at runtime based on the actual object.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">The method is not natively supported in Python.\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Supported natively in Python\u00a0<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"frequently-asked-questions\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span><b>Frequently Asked Questions<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3 id=\"what-is-method-overloading-in-python\"><span class=\"ez-toc-section\" id=\"What_is_method_overloading_in_Python\"><\/span><b>What is method overloading in Python?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">In Python, method overloading allows a class to have multiple methods with the same name but different parameter lists. Using default or variable-length arguments (*args, **kwargs) achieves this, enhancing method versatility and adaptability.<\/span><\/p>\n<h3 id=\"how-is-method-overriding-implemented-in-python\"><span class=\"ez-toc-section\" id=\"How_is_method_overriding_implemented_in_Python\"><\/span><b>How is method overriding implemented in Python?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">To achieve method overriding in Python, you define a method in a subclass with the same name and parameters as in its superclass. It allows the subclass to provide specific implementation, customising the method&#8217;s behaviour.<\/span><\/p>\n<h3 id=\"can-python-support-method-overloading-natively\"><span class=\"ez-toc-section\" id=\"Can_Python_support_method_overloading_natively\"><\/span><b>Can Python support method overloading natively?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">No, Python does not natively support method overloading. Instead, you can use techniques such as default or variable-length arguments (*args, **kwargs) to create methods that handle multiple argument combinations, achieving similar functionality.<\/span><\/p>\n<h2 id=\"conclusion\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><b>Conclusion<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In conclusion, understanding the differences between method overloading and method overriding in Python is essential in OOP. While the ideas are easily confused, you need to have a clear understanding of these concepts before you apply them to companies.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you want to learn Python programming methods, you can significantly opt for <a href=\"https:\/\/www.pickl.ai\/course\/free-data-science-courses\">online Data Science Courses<\/a> or Data Science Bootcamps. Pickl.AI ensures you develop practical skills through its <\/span><span style=\"font-weight: 400;\">Python for Data Science<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">Data Science Job Guarantee Program<\/span><span style=\"font-weight: 400;\">.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Moreover, you can go through <\/span><a href=\"https:\/\/pickl.ai\/blog\/python-interview-questions\/\"><b>Python Interview Questions and Answers<\/b><\/a> <span style=\"font-weight: 400;\">to ace your interview with complete preparation on the questions you need to understand clearly.\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"Understand method overloading and overriding in Python with applications and critical differences.\n","protected":false},"author":12,"featured_media":8733,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[134],"tags":[1491,1490,1485,1487,1486,1488,1489,2208],"ppma_author":[2181,2185],"class_list":{"0":"post-4404","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python-programming","8":"tag-how-to-do-method-overriding-in-python","9":"tag-how-to-override-a-method-in-python","10":"tag-method-overloading-and-method-overriding-in-python","11":"tag-method-overloading-in-python","12":"tag-method-overriding-in-python","13":"tag-method-overriding-in-python-with-example","14":"tag-method-overriding-vs-method-overloading-in-python","15":"tag-python-programming"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Method Overriding &amp; Method Overloading in Python- Pickl.AI<\/title>\n<meta name=\"description\" content=\"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.\" \/>\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.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Simply Explaining Method Overriding &amp; Method Overloading in Python\" \/>\n<meta property=\"og:description\" content=\"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Pickl.AI\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-03T09:26:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-24T07:39:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg\" \/>\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\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashutosh Jindal, Ajay Goyal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashutosh Jindal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/\"},\"author\":{\"name\":\"Ashutosh Jindal\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/48e5807f1b07a57f84f83c988b7b480b\"},\"headline\":\"Simply Explaining Method Overriding &amp; Method Overloading in Python\",\"datePublished\":\"2023-08-03T09:26:28+00:00\",\"dateModified\":\"2025-07-24T07:39:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/\"},\"wordCount\":2014,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/programming-background-with-pers.jpg\",\"keywords\":[\"How to do method overriding in Python\",\"how to override a method in python\",\"method overloading and method overriding in python\",\"method overloading in python\",\"Method Overriding in Python\",\"Method Overriding in Python with example\",\"Method Overriding vs Method Overloading in Python\",\"python programming\"],\"articleSection\":[\"Python Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/\",\"name\":\"Method Overriding & Method Overloading in Python- Pickl.AI\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/programming-background-with-pers.jpg\",\"datePublished\":\"2023-08-03T09:26:28+00:00\",\"dateModified\":\"2025-07-24T07:39:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/48e5807f1b07a57f84f83c988b7b480b\"},\"description\":\"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/programming-background-with-pers.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/programming-background-with-pers.jpg\",\"width\":1200,\"height\":628,\"caption\":\"Method Overriding & Method Overloading in Python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/method-overriding-method-overloading-in-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python Programming\",\"item\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/category\\\/python-programming\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Simply Explaining Method Overriding &amp; Method Overloading in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/\",\"name\":\"Pickl.AI\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/#\\\/schema\\\/person\\\/48e5807f1b07a57f84f83c988b7b480b\",\"name\":\"Ashutosh Jindal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/avatar_user_12_1676961741-96x96.jpg38356b20cc13cfe8aad90dec96678b5b\",\"url\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/avatar_user_12_1676961741-96x96.jpg\",\"contentUrl\":\"https:\\\/\\\/pickl.ai\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/avatar_user_12_1676961741-96x96.jpg\",\"caption\":\"Ashutosh Jindal\"},\"sameAs\":[\"https:\\\/\\\/medium.com\\\/@ashutoshjindal1\"],\"url\":\"https:\\\/\\\/www.pickl.ai\\\/blog\\\/author\\\/ashutoshjindal\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Method Overriding & Method Overloading in Python- Pickl.AI","description":"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.","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:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/","og_locale":"en_US","og_type":"article","og_title":"Simply Explaining Method Overriding &amp; Method Overloading in Python","og_description":"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.","og_url":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/","og_site_name":"Pickl.AI","article_published_time":"2023-08-03T09:26:28+00:00","article_modified_time":"2025-07-24T07:39:59+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","type":"image\/jpeg"}],"author":"Ashutosh Jindal, Ajay Goyal","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ashutosh Jindal","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#article","isPartOf":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/"},"author":{"name":"Ashutosh Jindal","@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/48e5807f1b07a57f84f83c988b7b480b"},"headline":"Simply Explaining Method Overriding &amp; Method Overloading in Python","datePublished":"2023-08-03T09:26:28+00:00","dateModified":"2025-07-24T07:39:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/"},"wordCount":2014,"commentCount":0,"image":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","keywords":["How to do method overriding in Python","how to override a method in python","method overloading and method overriding in python","method overloading in python","Method Overriding in Python","Method Overriding in Python with example","Method Overriding vs Method Overloading in Python","python programming"],"articleSection":["Python Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/","url":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/","name":"Method Overriding & Method Overloading in Python- Pickl.AI","isPartOf":{"@id":"https:\/\/www.pickl.ai\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#primaryimage"},"image":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","datePublished":"2023-08-03T09:26:28+00:00","dateModified":"2025-07-24T07:39:59+00:00","author":{"@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/48e5807f1b07a57f84f83c988b7b480b"},"description":"This blog evaluates the differences between method overloading and method overriding in Python with examples and explaining how they work.","breadcrumb":{"@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#primaryimage","url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","contentUrl":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","width":1200,"height":628,"caption":"Method Overriding & Method Overloading in Python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.pickl.ai\/blog\/method-overriding-method-overloading-in-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pickl.ai\/blog\/"},{"@type":"ListItem","position":2,"name":"Python Programming","item":"https:\/\/www.pickl.ai\/blog\/category\/python-programming\/"},{"@type":"ListItem","position":3,"name":"Simply Explaining Method Overriding &amp; Method Overloading in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.pickl.ai\/blog\/#website","url":"https:\/\/www.pickl.ai\/blog\/","name":"Pickl.AI","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pickl.ai\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.pickl.ai\/blog\/#\/schema\/person\/48e5807f1b07a57f84f83c988b7b480b","name":"Ashutosh Jindal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/02\/avatar_user_12_1676961741-96x96.jpg38356b20cc13cfe8aad90dec96678b5b","url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/02\/avatar_user_12_1676961741-96x96.jpg","contentUrl":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/02\/avatar_user_12_1676961741-96x96.jpg","caption":"Ashutosh Jindal"},"sameAs":["https:\/\/medium.com\/@ashutoshjindal1"],"url":"https:\/\/www.pickl.ai\/blog\/author\/ashutoshjindal\/"}]}},"jetpack_featured_media_url":"https:\/\/www.pickl.ai\/blog\/wp-content\/uploads\/2023\/08\/programming-background-with-pers.jpg","authors":[{"term_id":2181,"user_id":12,"is_guest":0,"slug":"ashutoshjindal","display_name":"Ashutosh Jindal","avatar_url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/02\/avatar_user_12_1676961741-96x96.jpg","first_name":"Ashutosh","user_url":"https:\/\/medium.com\/@ashutoshjindal1","last_name":"Jindal","description":""},{"term_id":2185,"user_id":16,"is_guest":0,"slug":"ajaygoyal","display_name":"Ajay Goyal","avatar_url":"https:\/\/pickl.ai\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_16_1695814138-96x96.png","first_name":"Ajay","user_url":"","last_name":"Goyal","description":"I am Ajay Goyal, a civil engineering background with a passion for data analysis. I've transitioned from designing infrastructure to decoding data, merging my engineering problem-solving skills with data-driven insights. I am currently working as a Data Analyst in TransOrg. Through my blog, I share my journey and experiences of data analysis."}],"_links":{"self":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/4404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/comments?post=4404"}],"version-history":[{"count":23,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/4404\/revisions"}],"predecessor-version":[{"id":23353,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/posts\/4404\/revisions\/23353"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/media\/8733"}],"wp:attachment":[{"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/media?parent=4404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/categories?post=4404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/tags?post=4404"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.pickl.ai\/blog\/wp-json\/wp\/v2\/ppma_author?post=4404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}