Simon Willison’s Weblog

Subscribe

Monday, 20th December 2021

Annotated explanation of David Beazley’s dataklasses (via) David Beazley released a self-described “deliciously evil spin on dataclasses” that uses some deep Python trickery to implement a dataclass style decorator which creates classes that import 15-20 times faster than the original. I put together a heavily annotated version of his code while trying to figure out how all of the different Python tricks in it work.

# 5:05 am / david-beazley, python, til

2021 » December

MTWTFSS
  12345
6789101112
13141516171819
20212223242526
2728293031