Skip to content

Instantly share code, notes, and snippets.

@bnorick
bnorick / pythoni.py
Last active December 8, 2023 10:03
Pythoni: a Python REPL you can pipe data into for processing
#!/usr/bin/env python3
import argparse
import code
import functools
import inspect
import logging
import os
import pathlib
import shlex
import stat
@bnorick
bnorick / time_dict_merge.py
Last active January 22, 2020 15:03 — forked from treyhunner/time_dict_merge.py
Test performance of different dictionary merging functions in Python
"""
Results:
multiple_update: 56 ms
copy_and_update: 48 ms
dict_constructor: 56 ms
kwargs_hack: 44 ms
dict_comprehension: 97 ms
concatenate_items: 196 ms
union_items: 168 ms