Summary

The venerable ‘if’ statement is a cornerstone of program flow and busines logic, but sometimes it can grow unwieldy and lead to unmaintainable software. One alternative that can result in cleaner and easier to understand code is a state machine. This week Glyph explains how Automat was created and how it has been used to upgrade portions of the Twisted project.

Do you want to try out some of the tools and applications that you heard about on Podcast.__init__? Do you have a side project that you want to share with the world? With Linode’s managed Kubernetes platform it’s now even easier to get started with the latest in cloud technologies. With the combined power of the leading container orchestrator and the speed and reliability of Linode’s object storage, node balancers, block storage, and dedicated CPU or GPU instances, you’ve got everything you need to scale up. Go to pythonpodcast.com/linode today and get a $60 credit to launch a new cluster, run a server, upload some data, or… And don’t forget to thank them for being a long time supporter of Podcast.__init__!



Preface

Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.

I would like to thank everyone who supports us on Patreon. Your contributions help to make the show sustainable.

When you’re ready to launch your next project you’ll need somewhere to deploy it. Check out Linode at www.podastinit.com/linode and get a $20 credit to try out their fast and reliable Linux virtual servers for running your awesome app.

Visit the site to subscribe to the show, sign up for the newsletter, read the show notes, and get in touch.

To help other people find the show please leave a review on iTunes, or Google Play Music, tell your friends and co-workers, and share it on social media.

Your host as usual is Tobias Macey and today I’m interviewing Glyph about Automat, a library that provides self-service finite-state machines for the programmer on the go.

Interview

Introductions

How did you get introduced to Python?

What is a state machine and when might you want to use one?

There are a number of libraries available on PyPI that facilitate the creation of state machines. Why did you feel the need to build a new option and how does it differ from what was already available?

Why do you think developers fall into the trap of complicated conditional structures rather than reaching for a state machine?

For someone who wants to integrate Automat into their project how would they go about that and what are some of the gotchas that they should keep in mind?

What do the internals of Automat look like and how did you approach the overall design of the project?

What are some of the more difficult aspects of designing and implementing state machines properly?

What are some of the technical hurdles that you have been faced with in the process of building a library for implementing state machines?

What do you have planned for the future of Automat?

What are some of the most interesting use cases of Automat that you have seen?

Keep In Touch

Email

@glyph on Twitter

Glyph on GitHub

Picks

Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA