1. TypedDicts are better than you think

    TypedDict was introduced in PEP-589 which landed in Python 3.8.

    The primary use case was to create type annotations for dictionaries. For example,

    class Movie(TypedDict):
        title: str
    
    
    movie: Movie = {"title": "Avatar"}
    

    I remember thinking at the time that this was pretty neat, but I tend to use dataclass …

    read more
  2. Closing Python Iterators

    I recently came across a video by mcoding about Python iterators' unfortunate closing behaviour.

    To sum up the video, when an iterator is interrupted we intuitively we would expect the exit of a context manager or a finally block to be called but that's not necessarily the case. For example …

    read more
  3. Free Threaded Python With Asyncio

    With the imminent release of Python 3.13, I wanted to look at the biggest changes coming to Python. I think by far the most exciting feature is free-threaded Python from PEP-703.

    As I'm quite late to the party, there's already a lot of articles talking about it. I came …

    read more
  4. My First Blog Post

    My name is Jamie Chang, I'm a software engineer in London. I like all things Python, but I'll try to mix it up sometimes. I decided to start this blog to get some of the ideas out from my head and to practice communicating technical topics.

    For this site, I'm …

    read more

social