mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-03-19 22:59:41 +01:00
Add underscore for dunder methods. (#4920)
This commit is contained in:
parent
5368f9a16a
commit
7c5b49876a
@ -5,7 +5,7 @@ A method in python is somewhat similar to a function, except it is associated wi
|
||||
- The method is implicitly used for an object for which it is called.
|
||||
- The method is accessible to data that is contained within the class.
|
||||
|
||||
Dunder or magic methods in Python are the methods having two prefix and suffix underscores in the method name. Dunder here means “Double Under (Underscores)”. These are commonly used for operator overloading. Few examples for magic methods are: **init**, **add**, **len**, **repr** etc.
|
||||
Dunder or magic methods in Python are the methods having two prefix and suffix underscores in the method name. Dunder here means “Double Under (Underscores)”. These are commonly used for operator overloading. Few examples for magic methods are: **`__init__`**, **`__add__`**, **`__len__`**, **`__repr__`** etc.
|
||||
|
||||
Visit the following resources to learn more:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user