
Ask HN: Learning Advanced Python - poplarstand
I&#x27;ve accidentally assumed the role of local Python guru at my current company. Coworkers ask me about best practices, popular libraries, and deployment tooling. I find it very flattering, but I&#x27;m really just a tinkerer with a language preference.<p>Would anyone be able and willing to recommend me some sources to help in answering their questions? In particular, I&#x27;d be interested in hearing about:<p>* Publicly hosted examples of great Python code<p>* Concise, well-written books that discuss Python best practices and &quot;gotchas&quot;<p>* Tip sheets and style guides<p>Thank you in advance for any assistance you can offer.
======
knopkop_
I've seen many recommendations for the book 'Fluent Python'.

~~~
erikschoster
Reading this was really useful for me. It does a great job of going into depth
on high level topics like the python data model and also goes deep into lots
of more isolated practical topics like covering useful data structures buried
in the standard library, a very good discussion of unicode, and concurrency
topics, etc, etc.

Python is changing a lot and there is for example no in-depth discussion of
the typing module in this book because PEP 484 had only just been written the
year before its publication. There's still about four pages dedicated to the
topic written as an aside to chapter 11 which discusses interfaces.

Even though it's 5 years old and there have been plenty of additions to the
language in that time, I think the book is still plenty useful today -- I
still pull it off the shelf as reference from time to time if I'm going into
the weeds.

------
existencebox
It makes me chuckle a little bit that you feel this way, only because I
recently took on similar roles in my own career, and, despite working directly
with python luminaries for pretty much the last ~5 years, I still constantly
question my expertise next to them. (I say this to perhaps lend solidarity/"it
might not be as bad as we fear")

That said, let me give some actual answers to your questions.

1\. Good hosted code. I actually asked this exact question to a python core
dev a few years ago when having the same concerns you are, and I'll point you
to where they pointed me: [0] (Obviously this is only one breadcrumb but it
may serve to lead you to more)

2\. This is a hard question since I personally shy away from books as opposed
to code samples/going elbow deep. Many moons ago I used to hear "dive into
python" recommended a lot but this advice may be very dated, so I'd leave this
to other responders who may have more up-to-date advice.

3\. There are a few here; [1] is kinda the "obvious" one if you weren't aware,
we also produce a "targeted" version for my dev team (I'll caveat ahead of
time, I work for the python folks at MS so I obviously have the bias of this
coming to mind first, but this is our style/contribution guide. I'll also be
open that we regularly find things we want to detail more effectively, so it's
definitely a 'living document.' [2] In an effort to offset some of my bias :P
I'd mention that the Google style guides are also notoriously good, although I
am familiar with those in other spaces, such as the SRE handbook/C++ style
guide.)

[0]
[https://github.com/brettcannon/gidgethub](https://github.com/brettcannon/gidgethub)
[1] [https://pep8.org/](https://pep8.org/) [2] [https://azure.github.io/azure-
sdk/python_documentation.html](https://azure.github.io/azure-
sdk/python_documentation.html)

Outside your bullets I'd mention the things that most helped me start
overcoming my own concerns about being sufficiently experienced:

1\. Force myself to broach ALL of the aspects I'd black boxed for years.
Packaging, _proper_ async practices, keeping myself honest WRT style via
black, AST, etc (obviously tune this list towards the things your team uses,
the crux of this thought is more, "I used to be fine with a 'pretty good'
grasp and some duct tape, I now need to go deeper to actually ensure CONFIDENT
knowledge.")

2\. Constructive post-mortems of my own code. Having individuals more
experienced than you participate is invaluable, but not necessary. Things
like, "what did I miss? What did I do wrong? What here is non-idiomatic or
regrettable?" and using that to guide a list of reminders I give myself when
doing work in the future; eventually these corrections become muscle memory.
This will be very well served by the questions you've asked in your original
post.

3\. This may sound silly but in supplementing 2/1/all of the above, actually
_keep up with what's going on in python._ Stuff I never did before or thought
was irrelevant, reading PEPs, reading email discussion lists, reading debates
about parts of the language I've never used or even style/semantic nitpicks
all gives me "osmosis knowledge" from other devs, if for no other reason than
exposing me to their thought processes, priorities, concepts and mental
models.

Don't hesitate to shout if I can clarify any of this, and good luck!

------
probinso
David Beazley, Raymond Heddinger, Brandon Rhodes

