PythonAsia 2026

PythonAsia 2026

Under the Hood: Hacking Python Data Types for Fun and Power
2026-03-22 , Pardo Hall (Secondary Hall)

All of us have wondered sometime, what really happens when a list is created, or compare dictionaries, or use objects as set keys in Python? This talk explores the inner workings of Python’s core data types — lists, tuples, dicts, sets, and more — from the perspective of internal implementation, memory, mutability, method resolution and more. We'll uncover how these types are implemented under the hood, and what it means to override or extend their behavior.

Along the way, we'll look at practical examples of customizing these behaviors using special methods. Let's make an immutable list or a mutable tuple, we’ll explore what’s possible, what’s dangerous, and what’s just plain fun.

Whether you're a Python enthusiast curious about how things work or a developer looking to write cleaner, more powerful abstractions, this talk will give you fresh insights into Python’s data model and how to harness it effectively.


Outline / Breakdown (30 minutes)

  1. Introduction (3 min)
    - Why look under the hood?
    - Teaser: an indexed set and immutable list in action.

  2. Python Data Model in Action (10 min)
    - How Python decides if objects can be compared or stored in sets/dicts.
    - How small implementation tweaks affect mutability and usability.

  3. The Hacks & Demos (14 min)
    - Demo 1: Making a list immutable
    - Demo 2: Mutable tuple (and its pitfalls)
    - Demo 3: Hashable dict
    - Demo 4: Ordered set - Custom ordering rules for sets/dicts
    - Demo 5–8: Additional fun/edge cases (slots, shadowing built-ins, subclass quirks, etc.)

  4. The Good, the Bad, and the Dangerous (2 min)
    - When these hacks help in real-world scenarios.
    - When they become risky or unmaintainable.

  5. Wrap-up + Q&A (1 min)
    - Key lessons to remember.
    - Closing thoughts: Python gives you superpowers — use wisely.


Category: Core Python/Advanced Language Features Audience Level: Beginner

Vivek Keshore is working with EPAM Systems as Software Architect. He is a Python engineer with 12+ years of experience building scalable systems, developer tools, and backend platforms. He has led teams across diverse domains, from data engineering to cloud-native applications, and is deeply involved in the Python open-source and community ecosystem. Vivek is a frequent speaker at various Python conferences and local meetups. Outside of work, he enjoys exploring how technology and creativity intersect from AI to developer experience tooling and contributing to the growth of the Python community with mutual learnings and sharing knowledge.