Learn Python ASTs, by building your own linter
In general, for me at least i find the best way to learn about something is to work in the 'internals'. For instance when react came i couldn't wrap my head around it so i started my own js framework, and it ended up almost exactly like react (then i dumped it as it ended up just being a learning exercise)