Live data from Hacker News

Think Python, 3rd Edition

allendowney.github.io

71–80 of 126 posts

Re: Think Python, 3rd Edition

#71
post #68

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

I like https://effectivepython.com/ Also just reading Norvig’s annual Advent of Code implementations usually provides some insight on how to write elegant and concise Python code.

Looks like there's a new edition coming in March. https://www.amazon.com/Effective-Python-Specific-Software-De...

Re: Think Python, 3rd Edition

#73

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

Reading the docs proactively (not just when you need something).

Re: Think Python, 3rd Edition

#74
post #70

Earlier quoted context omitted.

That is correct. Honestly I’m not sure this is a good use case for Python but it’s definitely possible. I’ve used the RabbitMQ + gevent + multiprocessing pattern in the past and it works but I find the code extremely hard to reason about. If I were doing it again from scratch I’d probably choose another language with better concurrency primitives.

> Honestly I’m not sure this is a good use case for Python but it’s definitely possible It definitely isn't, but this is a new role with a rushed timeline in a place dominated by Python. > and it works but I find the code extremely hard to reason about This is also a major concern of mine.

Rather than handling the multiprocessing and message passing yourself it would be much easier to use celery + gevent and let celery do the work of spinning up processes for executing the tasks.

It may feel limiting but my advice would be to keep all the celery job queue stuff isolated from your server, especially if you are using an async web framework. Have your web server just put all the jobs in the celery queue and let it handle executing them, regardless of whether they’re cpu or io-bound. If you try to optimize too much by doing something like leaning on celery for cpu-bound tasks but letting your web server handle the io-bound ones you’re going to be in for a world of hurt when it comes to both debugging and enforcing the order of execution. Celery has its warts but you’ll at least know where in the system your problem is and have reasonably good control over the pipeline.

Re: Think Python, 3rd Edition

#75

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

Fluent Python is good book at that level, and works as a good reference book while working too.

Re: Think Python, 3rd Edition

#76

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

Python Modules of the Week (PYMOTW). Great resource to learn the stdlib.

https://pymotw.com/3/

Re: Think Python, 3rd Edition

#77
post #69

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

I learned Python starting with 1.5.2 from the official documentation and think it's a good resource. https://docs.python.org/3/tutorial/index.html https://docs.python.org/3/library/index.html Whenever a new version is released, I read its What's New documentation. Beyond that, I like to read source code, both for the stdlib and popular third-party packages. This advice generally applies when I'm learning any new lang…

I really enjoyed Fluent Python a while back as an intermediate book.

Python official docs are not completely horrible, but compared to most other popular languages (Kotlin, Scala, Rust, Go at least), the Python official docs are kind of meh.

I suppose Python docs beat C and C++ which do not have official docs besides the spec. (not counting K&R and Bjarne's books).

Also I guess Javascript does not have official docs (ie MDN is not official)

Re: Think Python, 3rd Edition

#78

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

Fluent Python is good book at that level, and works as a good reference book while working too.

I have bought this book for every friend learning python for work purposes, really fleshes a lot out that's not taught implicitly. The data model stuff is really useful.

Re: Think Python, 3rd Edition

#79

Apologies for changing the subject, but aside from real world experience (which I have and am getting at work), is there a resource of similar quality for more intermediate/advanced Python programmers? I always feel like there's a big chunk of the language or stdlib I do not know.

Humble Bundle had some nice collections on Python for many uses. For in general, I remember that Serious Python and Automate the Boring Stuff with Python were both good.

Re: Think Python, 3rd Edition

#80
post #67

What is a good book for learning Python when you already now some/many other languages?

Just follow the tutorial (yes, really) https://docs.python.org/3/tutorial/index.html

It's what I started with, but honestly it's not great. It also heavily overemphasizes the interactive interpreter
Post reply on HN