News for hackers. Stuff that matters.
Re:Why Python Runs Slow, Part 1: Data Structures by tterrace on Thursday February 13, 2014 @08:17AM (#7231129)
Here's a neat (and totally unpythonic) way to bring that down a bit:

    python -m timeit --setup "from collections import namedtuple; Point = namedtuple('Point', ['x', 'y']); p = Point(x=0, y=0); get_y = Point.y.fget; get_x = Point.x.fget" "get_x(p) + get_y(p)"

There are no comments on this comment yet.