HNHacker News
TopNewBestAskShowJobs

gjenks

105 karma · joined August 30, 2011

listen | learn | think | solve http://www.grantjenks.com/
submissionscomments
gjenks··on Black, the uncompromising Python code formatter, is stable
Try “blue” instead: https://pypi.org/project/blue/ It’s mostly black with some monkey patching for single quotes. (I’m on of the authors. Feedback welcome!)
gjenks··on Black, the uncompromising Python code formatter, is stable
There’s also “blue” which I’m the author of and looks similar: https://pypi.org/project/blue/ would love to get your help and thoughts in the issue tracker or by email.
gjenks··on The CPython Bytecode Compiler Is Dumb
Closest thing to a spec is the Python Language Reference: https://docs.python.org/3/reference/ which is actually pretty good.
gjenks··on Python SortedContainers at Scale
Author here. Longish article but I wanted to make a fairly comprehensive reply to those who have doubted SortedContainers' ability to scale. If you jump down to the benchmarks section, you'll see the performance at 10,000,000,000 (ten billion) elements. I ended up paying $40 to rent a highmem instance on GCE for 1,011 minutes to run the benchmarks. For those curious, the memory high-water mark was ~128GB using PyPy. These results would be a lot more expensive to replicate with any other sorted collections library today.
gjenks··on Show HN: Python DiskCache – Django Compatible Cache Library
Author here. I created this because the filebased cache backend that ships with Django is really broken for caches with more than 1,000 keys. The design of DiskCache is based on SQLite and the filesystem which is a pretty solid combination. Frequent cache reads are stored in shared memory-mapped files while remaining thread and process safe. That makes lookups faster than networked options like memcached and redis.
gjenks··on Ask HN: Examples of meta programming or AST-hacking in Python?
I wrote a Python module called PyPatt that implements Pythonic Pattern Matching as you'd find in functional languages. There's both a function-based and macro-based version. The macro version is deprecated but was used for a while.

Docs: http://www.grantjenks.com/docs/pypatt-python-pattern-matchin... Source: https://github.com/grantjenks/pypatt_python_pattern_matching...