Skip to content Skip to sidebar Skip to footer
Showing posts with the label Python Internals

Why Don't Tuples Get The Same Id When Assigned The Same Values?

When I executed the following steps, both tuples (a and b) haven't retained their original IDs … Read more Why Don't Tuples Get The Same Id When Assigned The Same Values?

Python 3.4 Multiprocessing Queue Faster Than Pipe, Unexpected

I am doing an audio player that received samples from an udp socket, and everything was working fin… Read more Python 3.4 Multiprocessing Queue Faster Than Pipe, Unexpected

Efficiency Of Sorting By Multiple Keys In Python

I have a list of strings that I want to sort by two custom key functions in Python 3.6. Comparing t… Read more Efficiency Of Sorting By Multiple Keys In Python

Memory Size Of List Python

I was experimenting something with lists and I came around self-referencing lists. I searched throu… Read more Memory Size Of List Python

What Is The Default Binding To The `__import__` Attribute Of The Module `builtin`?

From Python in a Nutshell Custom Importers An advanced, rarely needed functionality that Python of… Read more What Is The Default Binding To The `__import__` Attribute Of The Module `builtin`?

Python 2 Assumes Different Source Code Encodings

I noticed that without source code encoding declaration, the Python 2 interpreter assumes the sourc… Read more Python 2 Assumes Different Source Code Encodings

Fraction Object Doesn't Have __int__ But Int(fraction(...)) Still Works

In Python, when you have an object you can convert it to an integer using the int function. For ex… Read more Fraction Object Doesn't Have __int__ But Int(fraction(...)) Still Works

How Does __slots__ Avoid A Dictionary Lookup?

I've heard that __slots__ makes objects faster by avoiding a dictionary lookup. My confusion co… Read more How Does __slots__ Avoid A Dictionary Lookup?