Real Python
  • Start Here
  • Learn Python
    Python Tutorials →
    In-depth articles and video courses
    Learning Paths →
    Guided study plans for accelerated learning
    Quizzes & Exercises →
    Check your learning progress
    Browse Topics →
    Focus on a specific area or skill level
    Community Chat →
    Learn with other Pythonistas
    Office Hours →
    Live Q&A calls with Python experts
    Podcast →
    Hear what’s new in the world of Python
    Books →
    Round out your knowledge and learn offline
    Reference →
    Concise definitions for common Python terms
    Code Mentor →Beta
    Personalized code assistance & learning tools
    Unlock All Content →
  • More
    Learner Stories Python Newsletter Python Job Board Meet the Team Become a Tutorial Writer Become a Video Instructor
  • Search
/
  • Join
  • Sign‑In

— FREE Email Series —

🐍 Python Tricks 💌

Python Tricks Dictionary Merge

🔒 No spam. Unsubscribe any time.



Table of Contents

  • Getting to Know the .__dict__ Attribute in Python
    • The .__dict__ Class Attribute
    • The .__dict__ Instance Attribute
    • The .__dict__ Attribute in Functions
    • The .__dict__ Attribute in Other Objects
  • Inspecting .__dict__ With the Built-in vars() Function
  • Manipulating Attributes With .__dict__
    • Accessing Existing Attributes
    • Modifying Existing Attributes
    • Adding New Attributes Dynamically
    • Deleting Attributes
  • Comparing .__dict__ With Other Attribute Manipulation Tools
  • Exploring .__dict__ in Inheritance
    • Class .__dict__ in Inheritance
    • Instance .__dict__ in Inheritance
  • Using .__dict__ in Practice
    • Memoizing Data in Functions
    • Introspecting and Debugging Code
    • Serializing Data to JSON Format
    • Customizing Access, Mutation, and Deletion
    • Writing Robust Descriptors
  • Conclusion
  • Frequently Asked Questions
Learn Python
  • Start Here
  • Learning Resources
  • Code Mentor
  • Python Reference
  • Support Center
Courses & Paths
  • Learning Paths
  • Quizzes & Exercises
  • Browse Topics
  • Workshops
  • Books
Community
  • Podcast
  • Newsletter
  • Community Chat
  • Office Hours
  • Learner Stories
Membership
  • Plans & Pricing
  • Team Plans
  • For Business
  • For Schools
  • Reviews
Company
  • About Us
  • Team
  • Sponsorships
  • Careers
  • Press Kit
  • Merch
Privacy Policy ⋅ Terms of Use ⋅ Security ⋅ Contact
Happy Pythoning!
© 2012–2025 DevCademy Media Inc. DBA Real Python. All rights reserved.
REALPYTHON™ is a trademark of DevCademy Media Inc.
Real Python - Online Python Training (logo)