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

The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python

Python allows you to use *args and **kwargs in function definitions to accept an arbitrary number of positional and keyword arguments, respectively. Here is a simple example: Different types of function arguments In the above example, the arbitrary_args function is defined to accept any number of positional and keyword arguments using the *args and **kwargs… Continue reading The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python

Code == communication, on writing better variable names

Listen now: Naming things is hard! Hence in this episode we want to help you a bit with that and share 10 tips how to do this better so you will write more readable and meaningful variable names. Enjoy! Check out mentioned Pybites Developer Mindset program here. Having you build apps end-to-end and getting expert developer… Continue reading Code == communication, on writing better variable names

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