Document

Overriding vs Overloading

date
Apr 14, 2023
slug
overriding vs overloading
author
status
Public
tags
Python
summary
Overriding vs Overloading
type
Post
thumbnail
category
Document
updatedAt
Apr 14, 2023 01:51 PM

Overriding vs Overloading

date: April 14, 2023 updatedAt: April 14, 2023 at 12:07 AM
 
Python only supports overriding because it does not support overloading.
 

Overriding

Overriding is the act of redefining a method of the parent class in the child class, allowing for different implementations of the same method.
 

Overloading

Overloading is the act of implementing the same method with different parameter types or numbers. Since Python does not specify parameter types, it does not support overloading. However, Python allows for the use of variable arguments, which enables dynamic handling of parameter numbers.