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

How Does Cpython Determine Whether A User Supplied An Optional Argument?

I started wondering how CPython can tell the difference between None as a default argument and None… Read more How Does Cpython Determine Whether A User Supplied An Optional Argument?

Python Dictionary Iterator Performance

When working with dictionaries in Python, this page says that the time complexity of iterating thro… Read more Python Dictionary Iterator Performance

Python: Understanding Iterators And `join()` Better

The join() function accepts an iterable as parameter. However, I was wondering why having: text = &… Read more Python: Understanding Iterators And `join()` Better

Why Is 'new_file += Line + String' So Much Faster Than 'new_file = New_file + Line + String'?

Our code takes 10 minutes to siphon thru 68,000 records when we use: new_file = new_file + line + s… Read more Why Is 'new_file += Line + String' So Much Faster Than 'new_file = New_file + Line + String'?

Printing Without Parentheses Varying Error Message Using Python 3

When I try to use print without parentheses on a simple name in Python 3.4 I get: >>> prin… Read more Printing Without Parentheses Varying Error Message Using Python 3

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?

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`?

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)

Multiprocessing - Cancel Remaining Jobs In A Pool Without Destroying The Pool

I'm using map_async to create a pool of 4 workers. And giving it a list of image files to proce… Read more Multiprocessing - Cancel Remaining Jobs In A Pool Without Destroying The Pool