Fun with Python’s sys.getrefcount()

Python has a function called sys.getrefcount() that tells you the reference count of an object. For example, the following code,import sysprint sys.getrefco… Read more

Similar

Unravelling `Not` in Python

For this next blog post in my series of Python's syntactic sugar, I'm tackling what would seem to be a very simple bit of syntax, but which actually requires diving into multiple layers to fully implement: not. On the surface, the definition of not is ver... (more…)

Read more »

Switch Case in Python

What is a switch? The switch is a statement that evaluates the accuracy or similarity of the value of a certain input. But isn’t that the same thing that the if statement does? Let’s see this statement starting with bash scripting lang... (more…)

Read more »