Python Community Interview With Michael Kennedy
This week, our Python community interview is with none other than Michael Kennedy of Talk Python to Me fame.
You may know his authoritative voice, but do you know his Python story? Read on to find out about his journey with Python, what he thinks about when stuck in traffic, and his love for two wheels.
Ricky: Welcome to Real Python! If I recall correctly, you started out as a .NET developer, and you were even a Microsoft Certified Trainer. So I’m curious as to how you came to Python and what made you stick around?
Michael: Thanks for having me. Oh, this brings back memories. Yes, I was doing full time .NET development with C# for probably 10 years. It’s a language I still respect today.
I found my way to Python after wanting to branch out into areas outside of the Microsoft space. I guess this was probably 2012 or around then. I hadn’t been doing much outside of C++ and C# before then for some time other than JavaScript. (No one escapes JavaScript!) I looked at the popular languages, and this was just around the time Python was becoming popular and increasingly so.
I spent a few weeks learning Python and was pretty much hooked but didn’t know it.
I studied the language and ecosystem and found it to be really nice—much nicer than I expected. But I suffered the problem that everyone who knows some language really well does when they try something different. Everything I knew by heart was a challenge again. How do I create a web app? How do I host it? How do I query a database? And on and on.
I was willing to learn and did. But it was just that uneasiness that anyone would have, giving up the familiar path. However, I knew I was going to be hooked when I went back to write some C# code and found it way less tasteful than I had just a few weeks prior.
This is not to bash that language. But like all C-based languages, it had a lot of symbol noise, let’s say. Why do we need semicolons again? Why the massive love for parentheses and curly braces even when it’s (now) clear they are unneeded, etc. Here’s an example:
class Thing { public int TotalSales { get { int total = 0; foreach (var b in items) { total += b.value; } return total; } } }
class Thing: @property def total_sales(self): total = 0 for b in items: total += b.value return total
Makes one wonder why you’ve been typing all those symbols, all those years.
Since then, as I’ve learned more and more of the popular packages and standard library modules, I’ve just enjoyed it more every day. Now I run my entire business on a Python stack, and it has yet to let me down.
Ricky: You are, of course, the host of the most popular Python podcast—Talk Python to Me—which now has over 180 episodes. You’re also a co-host on the Python Bytes podcast with Brian Okken. That’s a lot of content! How do you continue to be so consistent each week, and keep the shows relevant and newsworthy? It must be a lot of work?
Michael: That is definitely a lot of content. But it’s a very rewarding project that is into its fourth year for Talk Python To Me, and third year for Python Bytes.
How am I still consistent? That’s a good question. I started the podcast because others were inconsistent. There have been Python-based podcasts before mine. But they all stopped producing episodes long before I got in the game. In fact, that’s why I felt I could get started, because there was such a lack of content.
I am consistent for a few reasons. First, when I started the podcast, I promised myself I’d do it every week for six months and then decide whether the community and I enjoyed it. After that much consistent content creation, you are pretty deep within the habit of doing so.
Second, by then I had several companies sponsoring the podcast. I thought maybe, just maybe, I could find a way to use the podcast to become independent of my day job. I didn’t hate my day job, but it doesn’t compare to doing what you think is truly valuable for the community and world. Once you accept money to produce a thing over a long period of time, consistency is just part of the agreement.
Finally, the listeners were so supportive of my work. It genuinely felt great producing the content for everyone. I looked forward to each episode I created. After all, I was learning so much from each one and continue to do so to this day.
As for keeping the show relevant and newsworthy, that is easy. For Python Bytes, that’s literally the topic (weekly news items), and we get tons of help from listeners all suggesting great new items each week.
For Talk Python To Me, this is harder. Each episode digs deeply into a topic. For the first 20 episodes or so, that was easy enough for me. I’d used SQLAlchemy for example, so asking Mike Bayer about it was just thinking back on my experience. But it quickly grew into spaces I had little experience with. I now spend quite a bit of time researching topics to cover each week. Any given episode has between 4–8 hours of research before we even press record.
That leads into the final part of your question: Yes, it is a lot of work. I’ve had folks ask me how much time I spend on the show each week. They’ve even said, “You have such a sweet deal. What do you spend on the podcast per episode? A few hours?” Well, that would be something! I probably spend about 2 days per episode between the research, outreach to guests, email correspondence, website development, sponsorship relationships, and much more.
That is a lot of time, but it is also literally the foundation of my business. The podcasts and the courses only work if they are both well known and high quality. It’s very fortunate that I’ve been able to transition my part-time podcast into a full-time job (podcast and courses). It lets me really stay focused and stay consistent.
Ricky: If our readers don’t know you from the podcast, they surely will know you for your excellent courses on Talk Python Training. One of the first courses I took when I began learning Python was your Python Jumpstart by Building 10 Apps course—which is excellent by the way. And you’ve just released a new course named Async Techniques and Examples. Could you tell us a little more about it and why you decided to focus on Async, specifically?
Michael: Thanks! The courses have been a true passion project for me. I’ve wanted to create the best online library for Python courses out there for a long time.
When I first started the podcast, I also wanted to start the courses. I saw them as going hand in hand, with each supporting the other. However, at the time I worked for a company that did in-person and online training courses for developers.
They afforded me a lot of freedom and flexibility. But what would not fly is my creating effectively a competing company in my spare time. So I started with the podcast, and then once I could go full time independently, my first action was to launch the training company and Python Jumpstart by Building 10 Apps on Kickstarter. That was a really fun experience and a huge success.
The new async course is super fun and something I felt really needed to exist for the community. It needs to exist for a few reasons. The Python async/concurrent programming story is a little hard to understand and make sense of, for many people. We have the GIL, which actually is covered very nicely on Real Python. This means normal threading was only effective for IO bound work. CPU bound work requires another API, multiprocessing with its own oddities and techniques.
Now, as of Python 3.5, we have the amazing async
and await
keywords. They are powerful and clean but add more choices and more fog to the situation. This doesn’t take into account the async features of Cython and its nogil
keyword.
So the first reason is there was a lot of confusion around async and Python. You hear of people leaving Python for Go explicitly because of Go’s “better” concurrency. Usually, the type of concurrency people are looking for is IO bound, which works extremely well in Python anyway.
The next reason is that async and concurrent programming is oddly taught in the wrong order. What I mean by this is that usually lots of confusing, low-level detail is presented up front. Then finally it’s put together into examples that are useful and compelling. But the learner has to make it that far for it to pay off. This is also often paired with dire warnings of thread safety and how hard race conditions are. All of this is true and accurate. But why start there?
I wanted a course that shows how productive, fun, and actually easy async is for many cases. Once the student sees the value, then you can dive into things like thread safety and so on.
Finally, there really just are not many async courses for Python out there. I only know of one other one, and it’s behind a subscription wall.
Ricky: It’s no secret that you’re a big fan of MongoDB. What do you find most appealing about it? And if someone has never used it before, why might they consider using it with their next Python project?
Michael: I am a big fan of MongoDB. Long ago, I was complaining to a friend about how painful deploying relational database apps was. About how it’s a pain to apply the migration scripts without downtime and things like that. He said, “Well, why don’t you just use MongoDB, and you won’t have that problem?”.
I took his advice, and he was right! Since then, I’ve launched 4 or 5 major projects on MongoDB. Both of my podcast sites (talkpython.fm and pythonbytes.fm) and the course site run on MongoDB.
I know some folks have had bad experiences with MongoDB. There were a few “best practices” that were not the default in MongoDB in the early days, and there are lots of stories about these. Most of them have been fixed, and if you know to avoid them, you’re in good shape. The one major gotcha still out there is that MongoDB runs without authentication unless you explicitly create an account.
That said, MongoDB has been totally bulletproof for me and my projects. It’s been powering these sites mentioned above for years without any downtime. I have literally never run a migration or upgrade script to deploy a new schema or data model.
Mongo’s flexible schema model and MongoEngine’s class-based ODM (think ORM for MongoDB) are just right for my projects. The websites run with super low latency. It’s pretty common to get 10–20 ms response time for non-trivial pages (from request to response out of the server).
I personally can totally recommend MongoDB for your projects. I also created a free course if people are interested at freemongodbcourse.com.
Ricky: Now the Python is out of the way, it’s time to talk about the fun stuff… Math! You have a master’s degree in Mathematics, and you did start your Ph.D. Any plans to finish it in the future, or has that ship sailed? I would imagine you still have a passion for it. Do you get to scratch that itch on a daily basis?
Michael: It’s sailed, over the horizon, and halfway to Antarctica! I did study math and still very much appreciate the beauty of everything about it. I was just thinking about the different types of infinity, the different sizes of infinity, on just the simple number line between [0, 1] while stuck in traffic last week.
But that’s not working in math, day to day. I believe software development is my true calling. I love doing it every day. What I learned in math was excellent preparation for development. The rules of mathematics and the “rules” (language, APIs, algorithms, big-O, etc.) of software are surprisingly similar. The types of thinking and problem solving are also quite comparable.
The career opportunity in software and entrepreneurship vs. mathematics is not comparable. It’s just better to build things people can use (software) rather than theories only 5–20 people in the world will understand and care about (math these days).
So I love it and still read books about it, but I’m not doing anything practical with math these days.
Ricky: Do you have any other hobbies or interests, aside from Python?
Michael: I’ve had many fun hobbies over the years. I do think it’s important to have a balance between computer time and other things in your life.
I’m pretty fortunate in that I basically have 3 really engaging aspects to my job that I would almost consider hobbies. I run the podcast and am really into improving that craft and connecting with the listeners. I am doing software development still almost daily. And running my business and the whole entrepreneurial side of things is amazing and fun.
In terms of actual hobbies, I love racing and anything with two wheels! I grew up racing BMX bikes in grades 1–5, then motocross through middle school and high school, and finally mountain bikes in college. My brothers and I built a motocross track in our backyard, and it was pretty common to come home from school, drop our backpacks, and spend an hour or two challenging each other to clear this series of jumps or just having a fun time.
These days, I only watch motocross and am also a huge fan of IndyCar. I still ride but keep it to mellow adventures with my wife on our street motorcycles around the mountains here in Portland, OR. It’s great to be able to share that experience of riding with her and my daughters, who jump on the back of one of our bikes.
Ricky: What do we have to look forward to in the future from Talk Python? Any secret projects you’d like to tell us about or anything you’d like to share and/or plug?
Michael: I have some projects involving exciting courses coming out. I’d actually like to be more forthcoming with what I’m working on there, but there is a surprising amount of “copying” my popular courses let’s say.
We have at least 4 courses in active development right now and a massive list of things we’d like to build. So in terms of courses, just expect us to keep working on new ones that we see the need for in the community. You can also expect some more world-class authors there creating content. I’m really honored to be able to work on the courses for everyone and make my dream of this resource and business a reality.
In terms of the podcast, no slowing down there. We have Talk Python and Python Bytes, and both are going strong. I just hope to bring better and deeper stories to the community on Talk Python and stay on top of the most exciting programming language out there with weekly updates on Python Bytes with my co-host Brian Okken.
Thank you all for having me here on Real Python. I’m a big fan of the resource you all have created. If readers are interested in my projects, please subscribe to the podcasts at talkpython.fm and pythonbytes.fm. If they have aspects of Python they’d like to learn either personally or for their team, check out our 100+ hours of courses at training.talkpython.fm.
Thank you, Michael, for joining me for this week’s interview. It’s been great having you on the other side of the interview mic.
As always, if there is someone you would like me to interview in the future, reach out to me in the comments below, or send me a message on Twitter.