An Apprentice Experiment in Python Programming
A couple weeks ago Zvi made an apprentice thread. I have always wanted to be someone's apprentice, but it didn't occur to me that I could just ...ask to do that. Mainly I was concerned about this being too big of an ask. I saw gilch's comment offering to mentor Python programming. I want to level up my Python skills, so I took gilch up on the offer. In a separate comment, gilch posed some questions about what mentors and/or the community get in return. I proposed that I, as the mentee, document what I have learned and share it publicly. Yesterday we had our first session. Background I had identified that I wanted to fill gaps in my Python knowledge, two of which being package management and decorators. Map and Territory Gilch started by saying that "even senior developers typically have noticeable gaps," but building an accurate map of the territory of programming would enable one to ask the right questions. They then listed three things to help with that: Documentation on the Python standard library. "You should at least know what's in there, even if you don't know how to use all of it. Skimming the documentation is probably the fastest way to learn that. You should know what all the operators and builtin functions do." Structure and Interpretation of Computer Programs for computer science foundation. There are some variants of the book in Python, if one does not want to use Scheme. CODE as "more of a pop book" on the backgrounds. In my case, I minored in CS, but did not take operating systems or compilers. I currently work as a junior Python developer, so reading the Python standard library seems to be the lowest hanging fruit here, with SICP on the side, CODE on the back burner. Decorators The rest of the conversation consisted of gilch teaching me about decorators. Gilch: Decorators are syntactic sugar. @foo def bar(): ... means the same thing as def bar(): ... bar = foo(bar) Decorators also work on classes. @foo class Bar: ... is t