1min snip

The Real Python Podcast cover image

Exploring Duck Typing in Python & Dynamics of Monkey Patching

The Real Python Podcast

NOTE

Understanding References and Immutable Objects in Python

Using Python, objects can have different references despite having the exact same name. While this concept holds true in a list comprehension, it differs in a for loop. The discussion touches upon edge cases related to handling references of immutable objects and the use of interned values. These interned values, like a set of integers and 'none,' have a single reference, impacting how they behave in the code. The explanation dives into how immortal objects work with 312, showcasing a unique behavior when using get ref count. The content emphasizes the nuances of naming objects, exploring references, and addressing potential confusion for beginners or intermediate Python users regarding Python's handling of references and objects.

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode