Why No Dry Run?
(Thanks to Brian for his feedback. All mistakes and omissions that remain are mine.)
Some commands have a --dry-run
option,
which simulates running the command but without taking effect.
Sometimes the option exists for speed reasons:
just pretending to do something is faster than doing it.
However,
more often this …
Managing Dependencies
(Thanks to Mark Rice for his helpful suggestions. Any mistakes or omissions that remain are my responsibility.)
Some Python projects are designed to be libraries, consumed by other projects. These are most of the things people consider "Python projects": for example, Twisted, Flask, and most other open source tools. However …
read moreTests Should Fail
(Thanks to Avy Faingezicht and Donald Stufft for giving me encouragement and feedback. All mistakes that remain are mine.)
"eyes have they, but they see not" -- Psalms, 135:16
Eyes are expensive to maintain. They require protection from the elements, constant lubrication, behavioral adaptations to protect them and more. However …
read moreThank you, Guido
When I was in my early 20s, I was OK at programming, but I definitely didn't like it. Then, one evening, I read the Python tutorial. That evening changed my mind. I woke up the next morning, like Neo in the matrix, and knew Python.
I was doing statistics at …
read moreComposition-oriented programming
Avoiding Private Methods
Assume MyClass._dangerous(self)
is a private method.
We could have implemented the same functionality without a private
method as follows:
- Define a class
InnerClass
with the same__init__
asMyClass
- Define
InnerClass.dangerous(self)
with the same logic ofMyClass._dangerous
- Make
MyClass
into a wrapper class overInnerClass …
PyCon US 2018 Twisted Birds of Feather Open Space Summary
We would like Twisted to support contextvars -- this would allow cross-async libraries, like eliot to do fancy things.
Klein is almost ready to be used as-is. Glyph has the good branch which adds
- CSRF protection
- Forms
- Sessions
- Authentication
But it is too big, and we need to break it to …
read morePyCon 2018 US Docker Birds of Feather Open Space Summary
We started out the conversation with talking about writing good Dockerfiles. There is no list of "best practices" yet. Hynek reiterated for us "ship applications, not build environments". Moshe summarized it as "don't put gcc in the deployed image."
We discussed a little bit what we are trying to achieve …
read moreWheels
Announcment: My book, from python import better, has been published. This post is based on one of the chapters from it.
When Python started out, one of the oft-touted benefits was "batteries included!". Gone were the days of searching for which XML parsing library was the best -- just use the …
read moreWeb Development for the 21st Century
(Thanks to Glyph Lefkowitz for some of the inspiration for this port, and to Mahmoud Hashemi for helpful comments and suggestions. All mistakes and issues that remain are mine alone.)
The Python REPL has always been touted as one of Python's greatest strengths. With Jupyter, Jupyter Lab in its latest …
read more