this post was submitted on 30 Oct 2025
14 points (81.8% liked)

Python

7566 readers
2 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:

you are viewing a single comment's thread
view the rest of the comments
[–] KindaABigDyl@programming.dev 2 points 1 week ago* (last edited 1 week ago) (2 children)

Another reason why raw pointers are superior to object nonsense

Isn't "explicit is better than implicit" part of the Zen of Python?

[–] gedhrel@lemmy.world 1 points 1 week ago

Eh? You might suggest it's another reason why persistent (aka immutable) data-structures have merit; but this is raw pointers.

[–] logging_strict@programming.dev 0 points 1 week ago* (last edited 1 week ago)

Not everyone is a C or a Rust coder. In C, sending in a pointer, know it's pass by reference, not pass by value.

In Python, depends if it's immutable or mutable. Python coders eventually become hyper aware of the difference.

Python coders that want direct access to C libraries can use Cython CPython or ctypes. Probably missing a few options. Maybe others can chime in. This comes at the expense of much more complicated packaging.

Any package author that has underlying C code in their package automagically gains rock star status.