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

In Python, What Is The Difference Between F.readlines() And List(f)

From both Python2 Tutorial and Python3 Tutorial, there is a line in the midpoint of section 7.2.1 s… Read more In Python, What Is The Difference Between F.readlines() And List(f)

Why Does Tuple(set([1,"a","b","c","z","f"])) == Tuple(set(["a","b","c","z","f",1])) 85% Of The Time With Hash Randomization Enabled?

Given Zero Piraeus' answer to another question, we have that x = tuple(set([1, 'a', … Read more Why Does Tuple(set([1,"a","b","c","z","f"])) == Tuple(set(["a","b","c","z","f",1])) 85% Of The Time With Hash Randomization Enabled?

How Does Module Loading Work In Cpython?

How does module loading work in CPython under the hood? Especially, how does the dynamic loading of… Read more How Does Module Loading Work In Cpython?

What's The Runtime Of Python's Strip()?

What's the runtime of Python's strip()? Since remove is O(n) for a single char, is strip O(… Read more What's The Runtime Of Python's Strip()?

Why Is It Slower To Iterate Over A Small String Than A Small List?

I was playing around with timeit and noticed that doing a simple list comprehension over a small st… Read more Why Is It Slower To Iterate Over A Small String Than A Small List?

When To Use `<>` And `!=` Operators?

Couldn't find much on this. Trying to compare 2 values, but they can't be equal. In my case… Read more When To Use `<>` And `!=` Operators?