(Reposting from StackOverflow, where I got bashed for it)
I'm learning Python and am thus diving into tutorials on a regular basis. I appreciate that there is a variety of ways in presenting the materials, and that there's often something to learn in a tutorial even if I've mastered the "same" topic in another one.
What I am missing, though, is a tutorial that makes systematic use of code that is (or was) used in production by open-source projects, ideally with some commentary as to whether that is/ was a good choice in that particular context, and perhaps with challenges (and hints) on how to do it better, or pointers to patches that have been submitted to that effect.
In my view, such an approach to tutorials could raise the motivation in learners to engage with the code examples and structures in the tutorials. It would also increase the chances that learners (and probably teachers as well) would look at that production code and perhaps eventually come up with suggestions to improve it.
Are there any such tutorials out there? My main interest right now is Python, but I'd probably give a shot at such a tutorial for a different language as well.
While I am drafting this question, I am getting suggestions to related questions like this one, but none of them seems to deal with the idea of systematically using open-source production code for teaching the language in question.