2026 is shaping up to be a big year for AI agents. We are seeing more products where the AI not only answers a question but also does some work for the user. You have probably used ChatGPT or a similar AI tool to answer a question, help with writing, or explain some code. You type something, the AI responds, and the conversation goes back and forth. That is powerful, but it is also limited. The AI…
I compared execution time of code - which included CPU & I/O bound scripts and a WSGI app using the default and free-threaded Python 3.14 interpreters. This was for my talk: “Goodbye GIL - Exploring Free Threaded Mode in Python” at PyCon JP 2025 . The talk involved a demo running CPU & I/O bound workloads (standalone script and flask endpoints) with GIL enabled and disabled, and comparing the…
I created a Python project recently to test out Junie - the new AI coding agent from JetBrains. This led to the creation of Pyzlides , a Python library that lets us build presentation slides entirely as code. Interestingly, there are zero lines of code written by me; the entire codebase was generated by Junie. I started using PyCharm IDE back in 2019 for my work, and I’ve been hooked on it ever…
I attended Pycon US in Pittsburgh - This was my first in-person Pycon US. At this PyCon, I decided to try something different. I skipped most of the talks and focused on the hallway track - just walking around, meeting people, and asking questions. I was also presenting a poster at PyCon - on using Python to improve at chess: presentation materials here. Before the conference, I had prepared a few…
My first tutorial for Real Python got published 🎉 “Python Thread Safety: Using a Lock and Other Techniques”: https://realpython.com/python-thread-lock/ Why thread safety? Below is a classic example of creating a singleton class is Python: class SingletonClass ( object ) : def __new__ ( cls ) : if not hasattr ( cls , 'instance' ) : cls . instance = super ( SingletonClass , cls ) . __new__ ( cls )…
Since threads in Python share the memory space of their parent process, we might need to define thread-specific variables for specific use cases to avoid unintended side effects. In this article, we will: Explore Thread local storage: Python threading module’s solution for thread-specific/thread-private values. See its real-world example from Open-Source ( usage in the Peewee ORM library). Look at…
In Python, the sort method and the sorted callable are commonly used for sorting operations. sort is a list method which modifies the list in-place, whereas sorted takes an iterable as its first argument and returns a sorted list containing the iterables elements. Both of these use Timsort algorithm under the hood, to perform the sorting operation. In this article, we will explore the evolution of…
The partition method of str covers a niche use case - It is useful when a string needs to be split into exactly two parts based on a separator. It returns a three-membered tuple containing the part before, the separator itself, and the part after the separator. The split method is commonly used for splitting strings, which returns a list whose length can change based on the number of times the…
TIL - “Today I learned” series of Posts are short notes of new things I encounter with Python. While browsing the source of SQLAlchemy, I came across a custom list class The custom class is created by inheriting from List from typing , rather than the builtin list or the UserList class provided by collections It works. from typing import List class CustomList ( List ) : pass print ( CustomList .…
This is my account of meeting Guido Van Rossum and his advice on becoming a Python Core Developer. This interaction is a few months old and happened during Pycascades in Vancouver (18-19 March 2023). Yesterday a random thought about this interaction crossed my mind and I thought I should write a blog post on this. Pycascades & Python Conferences I flew from India to Vancouver to Speak at…
Thread Safety in Python Before getting started with Thread safety, let’s look into race conditions. Race Conditions From Wikipedia: A race condition or race hazard is the condition of an electronics, software, or other system where the system’s substantive behavior is dependent on the sequence or timing of other uncontrollable events. It becomes a bug when one or more of the possible behaviors is…
Building a Python REPL Themed Portfolio Website Launched the initial version of my Python REPL-themed portfolio website (with an ASCII art photo gallery) 🚀. Home Page Website: adarshd.dev or adarsh.pizza 🍕 Source code: github.com/adarshdigievo/Portfolio-REPL/ Internals UI layer and Python layer - both executed in the client browser The site can be considered to have two components. One is the…
You must have heard the saying that “In Python everything is an object” . Let’s take that statement literally and test it. Let’s check: The code in the below examples works as-is. No additional imports are required. We will be using isinstance function to check if ‘everything’ is an object. From Python Docs : builtin function isinstance(object, classinfo) : Return True if the object argument is an…