Doge log

Abby CTO 雑賀 力王のオフィシャルサイトです

2008-12-01から1ヶ月間の記事一覧

今年のふりかえり

とりあえず裏でコツコツ勉強しようと思ってた年だった。 来年からは少しエントリ増やす予定です。 まああと来年からPythonに本腰入れますよ!!

入れてるモジュール

最近Ubuntuをセットアップしたので入れたモジュールを挙げてみる。 In /opt/python26/lib/python2.6/site-packages: Zipped packages: PyAMF-0.3.1-py2.6.egg Tempita-0.2-py2.6.egg WebOb-0.9.4-py2.6.egg WebTest-1.1-py2.6.egg pyOpenSSL-0.7-py2.6-linux…

実装モジュールを切り替えるモジュール

昨日のコードをモジュール化するtry except ImportErrorとか多い書く人にはいいかも知れないな modinstaller.py from abc import ABCMeta, abstractmethod import sys def install(imports, *args, **kwargs): global _mod_name, _imports local = sys._getf…

実装モジュールを切り替える

pythonの定番パターンだと思うんだけどあんまり書いてなさげなので書いておく。 twisted厨にはおなじみのコードなのでtwisted厨はよまなくて良し!! 実装を抽象化しておき、モジュール切り替え + シングルトン化で使用する側は実装 を意識しないでよくする…

Python3000のパフォーマンス

The net result of the 3.0 generalizations is that Python 3.0 runs the pystone benchmark around 10% slower than Python 2.5. Most likely the biggest cause is the removal of special-casing for small integers. 以前は33%ぐらい遅かったはずなので…

Python3000のリスト内包表記

Python 3.1a0 (py3k:67517, Dec 4 2008, 22:33:17) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> l = [n for n in range(5)] >>> l [0, 1, 2, 3, 4] >>> l.__class__ >>> s …