何かを書き留める何か

数学や読んだ本について書く何かです。最近は社会人として生き残りの術を学ぶ日々です。

2015-08-16から1日間の記事一覧

『Effective Python』Item 33: メタクラスを使ってサブクラスの検証をしよう

『Effective Python』の続き。水際で防げ。 Effective Python › The Bookwww.effectivepython.com 『Effective Python』のChapter 4冒頭に筆者は次のように述べている。 Metaclass are often mentioned in lists of Python's features, but few understand w…

『Effective Python』Item 32: 属性の遅延評価には__getattr__, __getattribute__,__setattr__を使おう

『Effective Python』の続き。ナマケモノでいこう。 Effective Python › The Bookwww.effectivepython.com 遅延評価を__getattr__やgetattribute__、__setattr__で実現できますよ、という話。 __getattr__らは一般に、クラスの属性アクセスを制御するための…