9 ms·
Ask HN: Advanced Python Coding Books
What is a highly recommended advanced python (3.x+) concepts and coding book?
@decorators for class methods, type coercion, other stuff that may be deemed "interesting" or advanced that I'm not thinking of.
I came across a few books published ~2013 which I'd consider dated.
It may also just be a matter of reading the latest python documentation.
Thanks for any input.
- RMPR 5y agoEffective Python by Brett Slatkin is very good, still going through the Second Edition, but I like the practical side of this book. If you want to go really deeper like the inner working of CPython I'd recommend Anthony Shaw's CPython internals. It has been on my radar for some time now, still going through the serie of blog posts from tenthousandmeters[0] 0: https://tenthousandmeters.com/blog/python-behind-the-scenes-1-how-the-cpython-vm-works/ https://tenthousandmeters.com/blog/python-behind-the-scenes-...
- lsllc 5y agoThanks for the recommendation for Effective Python! As for the CPython Internals Series, I've been following that and it's really quite excellent (I just wish there was a dead-tree version of it -- I still prefer physical books).
- aroberge 5y agohttps://www.amazon.ca/CPython-Internals-Guide-Python-Interpreter/dp/1775093344/ref=sr_1_1?crid=26DC0WV3NSOFN&dchild=1&keywords=cpython+internals&qid=1624989925&sprefix=cpython+%2Camazon-devices%2C210&sr=8-1 https://www.amazon.ca/CPython-Internals-Guide-Python-Interpr...
- timellis-smith 5y agoAs an intermediate to advanced Python text book, I would highly recommend Fluent Python. It covers a lot of the fundamental concepts in Python explaining why a lot of things are as they are.
- FridayoLeary 5y agoAlso, can you recommend beginner python books. thanks.
- chevill 5y agoAutomate the Boring Stuff with Python and Python Crash Course were both pretty great. The first one you can read online for free legally. I'm not sure about the second one. https://automatetheboringstuff.com https://automatetheboringstuff.com
- stonecharioteer 5y agoTry Python 101 after reading Automate the Boring Stuff
- sitkack 5y agoI recommend checking out the talks by David Beazley https://dabeaz.com/talks.html https://dabeaz.com/talks.html
- kilodeca 5y agoRead the spec
- kleer001 5y agoCame here to comment similarly. A lot of smart people worked really hard on the manual. https://docs.python.org/3/ https://docs.python.org/3/
- asicsp 5y ago* Fluent Python * Serious Python * Practices of the Python Pro There are also good blog posts, SO answers, etc on many of these concepts. I have a few links collected here: https://learnbyexample.github.io/py_resources/specific.html https://learnbyexample.github.io/py_resources/specific.html
- fermigier 5y agoFluent Python 2nd ed. is available as a preprint on oreilly.com. Highly recommended.
- stonecharioteer 5y agoPython 201 is a great resource. I've recommended it to a lot of people. Fluent Python is also great. There is a physical version of the CPython book by Anthony Shaw. Additionally, have you tried visiting a random page of the Python Documentation? I recommend reading about the data model [1], or the execution model [2], the import system [3], and the data types sections [4] I also recommend reading a few of the PEPs. Some of the more recent ones which are really interesting are: 1. PEP 635 - Structural Pattern Matching: Motivation and Rationale [5] 2. PEP 636 - Structural Pattern Matching: Tutorial [6] 3. PEP 483 - The Theory of Type Hints [7] 4. PEP 572 - Assignment Expressions [8] The thing about books is that while they're are a good introduction, you won't get these things from the books. The docs exist for a reason, and if they're not good, feel free to file a PR. However note that the Python docs are really well written :) I also personally recommend the RealPython blog. It has a LOT of articles on the topics you mentioned. On the note of decorators btw, you should learn how to use two python functions: `id`, and `dir` [9]. They are the most powerful tools in my repertoire, and I only grok the advanced topics because I know how to use these. References: 1. https://docs.python.org/3/reference/datamodel.html https://docs.python.org/3/reference/datamodel.html 2. https://docs.python.org/3/reference/executionmodel.html https://docs.python.org/3/reference/executionmodel.html 3. https://docs.python.org/3/reference/import.html https://docs.python.org/3/reference/import.html 4. https://docs.python.org/3/library/datatypes.html https://docs.python.org/3/library/datatypes.html 5. https://www.python.org/dev/peps/pep-0635/ https://www.python.org/dev/peps/pep-0635/ 6. https://www.python.org/dev/peps/pep-0636/ https://www.python.org/dev/peps/pep-0636/ 7. https://www.python.org/dev/peps/pep-0483/ https://www.python.org/dev/peps/pep-0483/ 8. https://www.python.org/dev/peps/pep-0572/ https://www.python.org/dev/peps/pep-0572/ 9. https://realpython.com/lessons/dir-function/ https://realpython.com/lessons/dir-function/
- benzesandbetter 5y agoMy personal favorite is Expert Python Programming by Tarek Ziadé and Michał Jaworski. Python High Performance by Gabriele Lanaro is also quite good.