How do you take notes on .py files you didn't write?
I'm a Data Science & Engineering student. I use Obsidian for
everything, including university notes. There's a specific workflow
I've been going back and forth on and I'd like input from people with
more mileage.
The problem:
In class, professors hand us .py files to study. I didn't write them.
I need to understand them line by line and "make them mine", but I
don't want to modify the original file — I need it clean for reference
and for submission.
My question isn't how to run it or how to render it nicely — I already
use a plugin that renders the .py inside a note. The question is what
I do with my study annotations.
Options I'm considering:
A. A "mirror" .md note next to the .py: I copy relevant chunks into
code blocks, annotate them, and wikilink to concepts
([[recursion]], [[binary-tree]]). I duplicate code but I get a
navigable note.
B. A single .md note that just embeds the .py via the plugin, with
explanations written around it — no copied chunks. No duplication,
but my comments lose context if I look at the embedded block alone.
C. Commenting the .py itself. Ruled out — I don't want to touch the
original.
D. Something I'm not seeing.
For those of you who study code you didn't write (university, books,
inherited code at work), how do you handle this inside Obsidian?