I strived to follow PEP 8 standards (for the most part) and write the code in such a way that it runs on Python Version 3.
That being said, I want to emphasize that the concepts in this book apply to virtually all coding languages, and I expect that some people who are not as familiar with Python will be reading this book. Because of this, I’ve sometimes avoided certain Python idioms that I thought would utterly confuse people coming from other languages. It’s a tricky balance to keep the code Pythonic while also being welcoming to non-Python coders, but I hope that I’ve maintained an equilibrium that satisfies most readers.
Virtually all the code in this book can be downloaded online from the book’s web page. This code repository contains automated tests, too! I encourage you to check out the tests, as they are not included in the actual book and can help clarify how to run the main modules.
You’ll find some longer code snippets under the headings that read “Code Implementation.” I certainly encourage you to study these code samples, but you don’t necessarily need to understand every line to proceed to the next section of the book. If these long pieces of code are bogging you down, just skim (or skip) them for now.
Finally, it’s important to note that the code in this book is not production-ready. My greatest focus has been to clarify the concept at hand, and while I did also try to make the code generally complete, I have not accounted for every edge case and optimization. There’s certainly room for you to optimize the code further—so feel free to go crazy with that.