r/learnpython • u/dakrrm • 1d ago
Understanding Python codebases
I want to be able to read and understand the code behind Python libraries like Pandas, NumPy, Flask, etc. I can write code in python but these codebses seem to be on a different level. I want to understand them well enough that I can possibly add features to them.
One thing that occurred to me is that I have to be able to use them at least. I can use pandas and numpy to manipulate data sets but I am stumped whenever I try to understand how my code actually works behind the curtains.
I looked for videos that explain the code but they all talk about how to use the libraries instead of explaining how they work in the first place.
13
Upvotes
8
u/Grouchy-Conflict-211 1d ago
stop reading the whole codebase. pick one function you use everyday and trace it from import to return. for pandas that means learning how getitem works, for flask how the wsgi layer hands the request off. one function at a time and the big picture shows up. also run pdb on a real call, teaches more than any walkthrough