PyDev of the Week: Cory Benfield

This week we welcome Cory Benfield (@lukasaoz) as our PyDev of the Week! Cory is a core developer of the Python language, specifically on urllib3 as well as a core developer of the requests package. He is also the lead maintainer of the Hyper Project which is a set of related projects that provide HTTP/2 functionality to Python projects. Let’s spend some time getting to know Cory better!

Can you tell us a little about yourself (hobbies, education, etc):

I studied Physics at university in Scotland, originally with a bit of an eye towards ending up somewhere on the more practical end of professional physics: maybe doing something like medical physics. Before my degree, I’d never written a program in my life. However, I’d been a computer “power user” for a long time: I’d owned PCs and Macs and was comfortable in Linux as well as Windows and OS X, and I’ve been building PCs since I was 15. So when I found myself in a computational physics module staring at a Mathematica screen, something clicked in my brain and I realised that this was something I could be really happy doing. So I graduated with my masters degree in Physics and with a job offer to write software for the telecommunications industry.

When I’m not writing software, I like doing lots of different things to relax. I play video games (like most of the world now does), but I love watching great movies and TV shows. I also greatly enjoy cooking, reading, and spending time with people. Sometimes I even write: I’m not good at the discipline required to write regularly, but I think my writing is ok!

Why did you start using Python?

I’d just started using Mathematica for my Physics work in college, and while Mathematica is great it’s not really a useful tool for building utilities. So I glanced around for other languages, and it didn’t take long playing with C and Perl before Python seemed like the most obvious thing in the world to me. So I wrote some web scraping tools in Python, and that dragged me into the Python open source community. I’ve never looked back!

What other programming languages do you know and which is your favourite?

I’m the kind of person who likes to pick up and play with new languages for fun, so “know” gets a bit tricky here. I’d say I am most comfortable with Python, and then in roughly descending order of how idiomatic I am with the language: C, Go, Rust, Javascript, Swift, C#, Java, Objective C. I have dabbled a bit in the strongly functional languages, like Haskell, but wouldn’t say I “know” Haskell yet because I haven’t used it in anger yet. I also like Lisps, though again I haven’t written much Lisp code in anger: with that said, Hy is obviously my favourite lisp because it lets me use all the Python libraries I’ve already gotten used to!

What projects are you working on now?

Right now I’m spread pretty thin, but my major focus is HTTP and HTTP/2 in Python. That means that my time is spread roughly amongst maintaining several popular Python libraries: Requests and urllib3 being the most notable and the biggest drains on my time. Alongside those I maintain the only HTTP/2 libraries in Python, including hyper-h2, which is used as the basis for a number of HTTP/2 implementations in Python. Finally, I’m tangentially involved in a lot of other OSS Python projects, like the Python Cryptographic Authority and Twisted.

Which Python libraries are your favorite (core or 3rd party)?

Excluding my own, of course!

In the Python standard library I really like itertools: generators have a real appeal to me and itertools makes it possible to work with them in a really flexible way. Outside of the standard library, I think CFFI is awesome: being able to call into C regardless of how your VM is implemented is really powerful, and it removes one of the largest barriers to using PyPy, which I’d argue is one of the greatest assets of the Python community.

Where do you see Python going as a programming language?

It’s common in the Python community to worry about whether languages like Go are eating our lunch. I don’t buy into that rhetoric. Python is a great language: it’s clean, it’s easy to read, and when combined with tools like PyPy it’s more than fast enough for the majority of use-cases.

For now, I see Python consolidating, and building out tools that allow Python to integrate more tightly with other languages. Moving towards CFFI and away from writing explicit C extensions is a big part of this, as it allows Python programmers to combine the best of Python (e.g. PyPy) with the best of other languages (by calling into compiled DLLs without worrying about the specific Python implementation being used). Applications in the future will increasingly involve smaller components calling between each other, either via RPC mechanisms like HTTP APIs, or via direct function calls using things like CFFI. Python is well suited to be a part of that environment.

What is your take on the current market for Python programmers?

As far as I can tell, Python programmers are extremely employable. Python is a well established language that many companies would be willing to bet their businesses on, and that gives Python programmers a great deal of power and flexibility in the industry. Python skill is a great notch in the belt for anyone job hunting.

Is there anything else you’d like to say?

Only that if people are interested in getting involved in Open Source software, Python is almost certainly the language to do it in: there are lots of great projects floating around that would love more contribution from the community, and getting involved is a great way to give back.

Thanks for doing the interview!