Python
  • Initial page
  • Skills & Concept
    • Function
    • Generator
    • Class
    • Asyncio
    • Interface
    • Decorator
    • Maxin
    • Abstract Base Class
    • MemoryView
  • Magic methods
    • What is Magic Methods?
  • Data Structure
    • Data Structure in Python
    • List & Tuple
    • Named Tuples
    • Slicing in Sequence
    • Queue & Dequeue
    • Ordered Dict
    • Linked list
  • Writing Test Case
    • How to write Test case
    • Testing a Flask End-point
  • Libraries
    • Flask and Gunicorn
      • Flask JWT
      • Flask Limiter
      • Flask Rest
Powered by GitBook
On this page

Was this helpful?

  1. Magic methods

What is Magic Methods?

PreviousMemoryViewNextData Structure in Python

Last updated 6 years ago

Was this helpful?

The methods having two prefix and suffix underscores in the method name is called Magic Methods. They're special methods that you can define to add "magic" to your classes.

Reference

A Guide to Python's Magic Methods
Python Tutorial: Magic Methods