Should I use x.__len__() or len(x)?

Date Tags #python
In the context of providing type hints, someone had a function like this.
def f(x: Sized) -> Whatever: ...

And, since sized objects have a __len__() method it seemed sensible to use x.__len__(). It was a good question about the use of special methods.
My advice is to avoid using …
more ...

RESTful Web Services Design

Date Tags REST
This -- REST is the new SOAP -- has so many demolished strawman arguments that it feels like looking at a van Gogh painting of people harvesting wheat.
I won't dive into listing all the strawmen. Most of my responses are approximately "How is that an actual problem?" or "Yes, it was …
more ...



Python Interviews

The #Python Interviews book is out. Mike Driscoll interviewed a bunch of Python experts. And me, too. get 30% off the Amazon paperback version of the book using the code 30PYTHON: https://goo.gl/5A3uhq
Here's a flavor of how this went:

Driscoll: So how did you end up becoming …
more ...