We are excited to announce that we’ve extended our Newbie Bites from 25 to 50 Python exercises! 🎉 The importance of exercising when learning how to code 💡 We’re passionate about this new batch of exercises because they require active engagement, which is crucial for learning how to code. Passive methods like reading books or… Continue reading Learn Python From Scratch: We Extended Our Newbie Bite Exercises From 25 to 50 🐍 📈
Articles on type hints
Leveraging typing.Protocol: Faster Error Detection And Beyond Inheritance
By Bob Belderbos on 9 February 2024
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
What The Heck Is Yield For?
By Erik O'Shaughnessy on 11 October 2023
A question came up recently about the purpose of the Python yield expression and when you should use it. Consider this silly function that computes a list of integers from 0 to 99 raised to the given exponent: When called, this function runs thru all 100 integers in the range computing each term and then returns the… Continue reading What The Heck Is Yield For?
The Arbitrary (Keyword) Arguments (args and kwargs) don’t come “for free” in Python
By Bob Belderbos on 9 August 2023
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
How to create a self updating GitHub Readme
By Bob Belderbos on 21 November 2022
It was about time to give my GitHub profile a nice intro so inspired by Simon Willison’s blog post I decided to make an intro Readme that auto-updates. First I made a GitHub repo called bbelderbos, my username. That’s how it works: GitHub defaults to showing the Readme.md of your username’s repo on your profile page.… Continue reading How to create a self updating GitHub Readme
Code == communication, on writing better variable names
By PyBites Team on 6 September 2022
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 …
By PyBites Team on 16 August 2022
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
By PyBites Team on 28 July 2022
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
Code Better with Type Hints – Part 3
By Michael Aydinbas on 8 April 2022
This is the third part of a series of articles dealing with the type annotation system in Python, type hints for short. The second part discussed a set of beginner examples and highlighted the benefits of using type hints. This article series is aimed at newcomers to type hints and wants to help you get… Continue reading Code Better with Type Hints – Part 3
Code Better with Type Hints – Part 2
By Michael Aydinbas on 27 August 2021
This is the second part of a series of articles dealing with the type annotation system in Python, type hints for short. The first part gave an introduction to type hints. This article is aimed at newcomers to type hints and wants to help you get started. In this second part, I will go over… Continue reading Code Better with Type Hints – Part 2