Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance

Introduction Two weeks ago I wrote an article about ABCs and interface enforcement. Shortly after I learned that you can do this as well with protocols. Python 3.8 introduced quite a groundbreaking feature that further advanced the language’s capabilities in type checking: the typing.Protocol which allows Python developers to define and enforce interface contracts in… Continue reading Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance

Annotate all the things! Why you should care about Python type hints …

Listen now: This week we have Will Frey on the podcast: ML engineer, Python “knowledge dictionary” and type hints fan & geek. We talk about his background, how he learns / keeps up with Python’s fast moving ecosystem and of course we look at Python’s type hints in-depth: why care and some of his favorite tricks.  We… Continue reading Annotate all the things! Why you should care about Python type hints …

Documentation-driven development with Sebastián Ramirez

Listen here: This week Bob and Pybites Coach, Robin Beer, interview Sebastián Ramirez, the creator of FastAPI, Typer and SQLModel. We talk about:– What he is currently working on.– How to balance the large amount of opportunities in his space (open source developer productivity tips).– The process of designing new libraries that are the glue between other ones.– The feeling of… Continue reading Documentation-driven development with Sebastián Ramirez

Naughts and Crosses Gets a Little Help

Naughts and Crosses (Tic-Tac-Toe to some audiences) is a popular skill game often played by children. It can also be usefully employed to distract dial up computers, at NORAD for example, rather than allowing the ‘playing’ of Global Thermonuclear War. Would you like to play a game?

Abstract Syntax Trees in Python

In this article Alessandro provides an overview of Abstract Syntax Trees (ASTs), introduces a few use-cases, and showcases the ast module in the Python Standard Library. The content is structured in a top-down fashion, starting from general notion about an AST, and digging deeper up to the point of artificially manipulating an AST to “randomize” the content of some instructions.

3.6 new features

Finally got a chance to look into Python 3.6’s new features. In this post some highlights and pointers.