Copying Data Structures Quirks
Note
TL;DR — Copying fails if a value is an iterator.
To create a duplicate of a data structure, Python provides methods copy() and deepcopy(). Lately, I wanted to duplicate a nested structure with deepcopy() and encountered following issue:
TypeError: object.__new__(dict_keys) is not safe, use dict_keys.__new__()
And ...
more ...New Python Project “PySite”
If there’s a bunch of small websites you want to maintain, — who you’re gonna call?
Note
Introduction
For just a few pages, it may be tempting to just write static HTML files. If you just write them once and do not have to apply changes ...
High Performance Python: Profiling
Note
This article is part of an ongoing series about profiling Python programs that starts here [4].
Note
This text is a draft and may be subject to changes.
There are two things we can profile, execution time and memory consumption.
Profiling Execution Time, Part I
From the Linux command ...
High Performance Python: Prima Facie
Table of Contents
- Introduction (this article)
- The Fighty Engine [2]
- Profiling [3]
Introduction
Once in a while memories of old pet projects (or imagined pet projects) bubble up again. This time it was fighty.
Many years ago friends and I played an online browser game called The Arena (which still ...