前置き Python3.4のSingle-dispatchで遊んでみた - Python Advent Calendar 2013 — hirokiky's blog 読んだ瞬間、脳細胞に衝撃が! 「これはpprintのための新機能だ!」 「あの長いPrettyPrinter._formatがsingledispatchでプリチーに書ける!」 「自作クラスをpprintできるようになったに違いない!」 はやる心を抑え、3.4.0b1をダウンロード し、Lib/pprint.py をgvimで開くと、そこには!? 作ってみた というわけで、 Single-Dispatch を使ったpprintを実装してみました。 doloopwhile / single-dispatch-pprint Re-implementation of 'pprint' in Python Standard Libr