Talk

Under the Hood of Python Data Structures

Thursday, May 29

11:45 - 12:15
RoomFusilli
LanguageEnglish
Audience levelBeginner
Elevator pitch

Can we learn something useful by studying how Python data structures are implemented? In this talk I will try to answer this question. We’ll embark on a journey into the depths of Python, exploring CPython source code, binary logic, and experimenting with the Python console. It will be fun!

Abstract

As Python developers, we’re used to think high level: when we write a list we don’t think about how it is represented in memory. For someone learning Python as their first language, or for someone without a CS degree for example, this is not a given at all.

Take me, I didn’t know what a dictionary really was. I knew how to use one, sure. But I never asked myself how it actually worked. Well, until I started studying Rust.

With Rust, being a lower level language than Python, it’s harder not to think about the memory. So I learned what a HashMap is and I loved it: I finally understood why dictionaries were so amazing.

Python abstractions are fantastic because they allow us to focus on solving human problems rather than computer problems. But what I just learned tickled my curiosity, so I kept digging and then I asked myself a fundamental question: Can we learn something useful by studying how Python data structures are implemented under the hood?

More precisely: can we learn something, that we can use in our daily life and can make us better developers, writing better, faster (and greener) code, by studying how python data structures and their relative operations work under the hood?

In this talk I will explain a few concepts like:

  • Python implementations
  • Strongly vs Weakly typed languages
  • Static vs Dynamic types
  • Mutability and Immutability
  • How types are structured in Python

All of this before diving into Python’s built-in data structures, where we’ll examine some implementation code (in CPython), experiment with the console, and aim to learn something valuable from the experience.

TagsBest Practice, Compiler and Interpreters, Performance and scalability techniques, Algorithms and Data Structures
Participant

Salvatore Giammanco

My name is Salvatore Giammanco and I am a Software Developer currently working for 🐙 Kraken Technologies 🐙 as Software Engineer. I’m currently learning Rust programming language and I love it! I also love playing around with microcontrollers like Arduino and getting hands dirty since I was 14 years old.

I want to create technology, innovation and hope for a better future. We need sustainable systems which make us able to live on this planet, or others, for an UNLIMITED amount of time, without consuming the planet’s resources until they are depleted, and we need it now!

Our society should work like an ecosystem, in symbiosis with nature.