Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Why do some Python functions have underscores "__" before and after the function name?

We come across function names like __init__, __dict__, __call__ and so on.

What do the function have underscores before and after their function names?


1 Answer
Rajendra Dharmkar

We note that names with double leading and trailing underscores like mentioned above are essentially reserved for Python built-in functions. We are better off not using similar names.

Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.