こしごぇ(B)

旧:http://d.hatena.ne.jp/koshigoeb/

Python 再入門(2)

ポイントをつかんでおこうと思って選んだ本だけど、これはまだ手をつけるのは早かった模様。かろうじてCっぽいプログラムが書ける程度の記憶しか残っていないので、色々と思い出してから改めて。

参考書籍

エキスパートPythonプログラミング

エキスパートPythonプログラミング

構文ベストプラクティス

リスト内包表記

>>> [i for i in range(10) if i % 2 == 0 and i != 4]
[0, 2, 6, 8]

イテレータとジェネレータ

  • iter
  • next
  • __iter__
  • yield
  • send
  • throw
  • close
  • コルーチン
    • トランポリン
    • PyPI multitask
  • ジェネレータ式
  • itertools モジュール
    • islice, tee, groupy

デコレータ

  • @classmethod, @staticmethod
  • 引数チェック
  • キャッシュ
  • プロキシ
  • コンテキストプロバイダ

with と contextlib

  • __enter__
  • __exit__
  • contextlib モジュール
    • contextmanager, closing, nested