Python function dissecting

Beginner question:
I want to better understand existing Python-libraries, instead of just using them.
The learning curve from the basics to this and actual programming is quite steep imo.
Is there a way that lets you check, how existing functions are built - similar to dir()?