Home
Blog | Adarsh Divakaran
Cancel

Thread Local Data in Python

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, ...

Evolution of the `sort` in Python and the Role of `functools.cmp_to_key`

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 a...

Partition method of Python strings

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...

List from Typing module is inheritable

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 c...

When I met Guido van Rossum

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 2...

Thread Safety in Python

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 elec...

Building a Python REPL Themed Portfolio Website

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 ad...

It is said that, in Python everything is an object. I took that literally.

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...