This is now an actual repo:
# All units in usecs (µsec) comparing Python 2.7 | 3.7. | |
# Last updated: 2019-02-11 | |
# MacBook Pro (15-inch, 2016) | |
# macOS 10.14.3 | |
# 2.7 GHz Intel Core i7 | |
# 16 GB 2133 MHz LPDDR3 | |
python -m timeit "200 <= 250 < 300" # 0.0354 | 0.059 | |
python2.7 -m timeit "250 in xrange(200, 300)" # 1.25 |
#!/usr/bin/env python | |
""" Test HTTP Server | |
This script starts a http server that will respond to HTTP requests | |
with a predefined response. | |
Usage: | |
./http_server.py --port=8080 --code=404 --content="Page not Found" |
from Queue import Queue, Empty | |
from socket import (socket, error, AF_INET, SOCK_STREAM, SOCK_DGRAM, | |
SOL_SOCKET, SOL_TCP, SO_ERROR, TCP_NODELAY) | |
from errno import EINPROGRESS | |
from select import select | |
from threading import current_thread | |
from concurrent.futures import Future | |
from functools import partial | |
import sys | |
import os |
What I propose below is a Behaviour (or Story) Driven Development domain-specific language for writing your tests in Python. This uses some tricks of how imports are done (via encoding) to dynamically translate the tests from the DSL into pure Python. Additional tricks are used to preserve the line numbers of errors, offer abbreviated asserts, and automatically pass local variables from parent to child scopes.
This is parallelizable for efficient test running, compiles to Python bytecode for efficiency, and follows the same style as doctests.
If you hate DSLs (hey, Python ain’t Ruby!) consider this to be a file-length docstring. If you don’t like doctests then consider this to be a template engine for tests. (Most modern template engines generate Python code…)
noun ( pl. automata |-tə| or automatons ) — a moving mechanical device made in imitation of a human being.
- A machine that performs a function according to a predetermined set of coded instructions, esp. one capable of a range of programmed responses to different circumstances.
- A scripting infrastructure for project and system management.
Hi. My name is Sadayuki "Sada" Furuhashi. I am the author of the MessagePack serialization format as well as its implementation in C/C++/Ruby.
Recently, MessagePack made it to the front page of Hacker News with this blog entry by Olaf, the creator of the Facebook game ZeroPilot. In the comment thread, there were several criticisms for the blog post as well as MessagePack itself, and I thought this was a good opportunity for me to address the questions and share my thoughts.
To the best of my understanding, roughly speaking, the criticisms fell into the following two categories.
The attached CSV files represent the output of the coverage.py running each of the framework’s ‘hello {name}’ examples. Each provide effectively identical example code (one using explicit route/view registration, the other using object dispatch) with absolutely no framework options enabled at all.
The results speak for themselves:
Framework | Modules | Compiled | Executed | Skipped | Efficiency | v. Pyr | v. WC | RAM |
---|---|---|---|---|---|---|---|---|
Pyramid | 154 | 21,782 | 8,055 | 13,727 | 36.98% | 100% | 739% | 20.2M |
WebCore 2 | 39 | 1,938 | 1,089 | 849 | 56.19% | 13% | 100% | 14.4M |
I fully expect to be able to achieve functional immortality within my lifetime. Do not read that as plain immortality—I have little attachment to my own biology. Many argue against this on the basis of biological immortality and philosophical or physical concerns. Over-population, they say, would ruin us; immortality is unnatural the nay-sayers might quip. They might argue that no living creature is meant to live forever, despite several excellent examples of biological creatures that do live forever in a practical sense. Our life span, barring unforeseen events such as cancerous mutations or sudden impacts with a bus, is not fixed at 100 years of age. In 1900 the average life-span was just under a mere 50 years! With technology, we can do better, and have been improving steadily over time.
Let me back up for a moment and claim a specific, and I feel, realistic go