Aiohttp vs Multithreaded Flask for High I/O Applications

Date Tags python

Over the past year, my team has been making the transition from Flask to aiohttp. We're making this transition because of a lot of the situations where non-blocking I/O theoretically scales better:

  • large numbers of simultaneous connections
  • remote http requests with long response times

There is agreement that ...

more ...

deepmerge: deep merge dictionaries, lists and more in Python

Date Tags python

Introducing deepmerge. It's a library designed to provide simple controls around a merging system for basic Python data structures like dicts and lists.

It provides a few common cases for merging (like always merge + override, or raise an exception):

from deepmerge import always_merger, merge_or_raise

base = {
    "a": ["b"],
    "c": 1 ...
more ...

KeyError in self._handlers: a journey deep into Tornado's internals

Date Tags python

If you've worked with tornado, you may have encountered a traceback of a somewhat bewildering error:

Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/tornado/ioloop.py", line 832, in start
fd_obj, handler_func = self._handlers[fd]
KeyError: 16

A few other people have been confused ...

more ...


Global logging with flask

As of December 2016, Flask has a built-in logger that it instantiates for you. Unfortunately, this misses the errors and other log messages in other libraries that may also be valuable.

It would be nice to have a single logger, one that captures BOTH library AND app logs. For those ...

more ...

The Dangers of Patching

If you've ever used Mock (or the built-in mock in python 3), you'll know how powerful of a tool it can be toward making unit testing on functions modifying state sane. Mocks in Python are effectively a probe that you can send into a deep, dark function:

import ...
more ...

Pycon 2014: Day 2 Recap

The second day of PyCon was just as amazing as the first. The day started with a couple keynote speakers:

Keynote: Jessica McKellar

Jessica McKellar gave a talking about the current state of the world for programming classes in U.S. grade schools, and the numbers weren't pretty. The ...

more ...



Python Internals

Date Tags python

The internals of Python are actually pretty straightforward, but it's still worth a dive. I recently gave a talk at Zillow about it, so I'd thought I'd share some points here as well.

Everything here prefixed with >>> can be typed into the python interpreter (activated by typing ...

more ...

About Yusuke Tsutsumi
I work at Zillow. I focus on tools and services for developer productivity, including build and testing.

My other interests include programming language design, game development, and learning languages (the non-programming ones).