Lessons from Pycon 2017

This post describes some of the talks and things I learned at pycon this year. I got to see a limited subset of talks and I definitely missed a bunch of interesting ones- these are my favorites!

Requests Under the Hood #

This talk was more focused on software maintenance patterns than the requests library itself, which was used as an example throughout. It presented a few scenarios from the library where critical code for an infrequently-used feature was slowly added to throughout time.

Main takeaways:

Rants & Ruminations from 100 Job Interviews in Silicon Valley #

This was a great culture talk which dealt with a lack of respect shown in many common job application scenarios. The author relayed a number of relatable experiences over 100 interviews with various companies in the Bay Area.

Main takeaways:

Awesome Command-Line Tools #

This was a fun talk for me, being a lover of command-line interfaces. The author created tools like pgcli and mycli, which are impressively smart command-line shells for databases postgresql and mysql respectively.
They walked through a few examples of design principles to follow when creating user interfaces for tools, and gave a few libraries that are useful for implementing this in a pythonic fashion.

Libraries used:

Main takeaways:

Satellite Imagery using Python #

Code #

This was really interesting, and I would highly recommend watching the recorded talk. The presenter is good at illustrating what happens as they step through a jupyter notebook that illustrates doing cool things with satellite images, esp. animating them.

Main takeaways:

Algorithmic Music Generation #


This talk walks through how “easy” it is to generate entirely unique music using a large training set and a recurrent neural network implemented using the keras library.

Main takeaways:

Creating a Good Library API #

I have a few python libraries and polishing their APIs is a priority at all times, I paid close attention throughout this talk. The author stated four values for writing libraries:

An API should make the simple easy, the complex possible, and the wrong impossible

Main takeaways:

Running python in the Linux Kernel with bpf #

This guy was a good presenter with a great sense of humor about the ridiculousness of what he managed to fit into bpf’s stack-based machine. It was pretty impressive though,
and included a strace-esque syscall notifier that was implemented in like ~50 lines.

Main takeaways:

Immutable programming: Writing Functional Python #

This talk was an overview of different strategies one can take to program (mostly) functionally using python.
It spent a good amount of time talking about datastructures that are useful for this purpose, and how to write Command pattern code which can take inherently mutable parts of your codebase and glue them to the immutable core of the codebase.

Main takeaways:

Grok the GIL #

I liked this talk a lot. The presenter dove into the cpython codebase, pointed out situations where the GIL can be acquired and released, then walked through examples showing good places to use multiprocessing versus threading.

Main takeaways:

No Hands! Bikes with Python #

Code #

This talk used the really cool micropython project to build a practical speedometer for a bike! They walked (and biked) through the whole process. I would recommend watching this if you’re interested in microcontrollers.

Main takeaways:

Hacking Cars with Python #

Code #

This talk covered the connection between different computer components in a typical car and how to interface with its CAN network to perform different operations within the car.

Main takeaways:

Hacking Nintendo Games in Python #

This one was really fun. The presenter made a SMS gateway API to write memory addresses in an emulator, which led to the audience doing hilarious things with their game of Zelda.

Debugging in 3.6: Harder, Better, Faster, Stronger #


This was another impressive talk, where the presenter made their own frame evaluation debugger for 3.6 with a new field in PyCodeObject.

Keynote on Instagram’s python3 migration #

I missed the first part of this talk, so my notes are a bit incomplete.

Main takeaways:

Facts and Miscellany #

This is stuff I gleaned from presentations that wasn’t explicitly pointed out above.

How to define default args for a namedtuple:

from collections import namedtuple
Rectangle = namedtuple('Rectangle', ['height', 'weight'])
Rectangle.__new__.__defaults__ = (10, 20)

How to allow GIL re-acquisition every tick in cpython, which makes multithreaded contention bugs easier to reproduce:

import sys

How to disassemble python into bytecode:

import dis

Now read this

Installing “Real” Linux on an ARM Chromebook

I’m the proud owner of a Samsung Chromebook, first model, the lightest and longest-lasting laptop I’ve ever had the pleasure of owning. It’s got a dual-core ARMv7 processor at 1.7GHz, a quad-core GPU, and 2GB RAM. I’ve had it for a bit... Continue →