Python

pydoc の書き方

pydocはpythonに最初からはってるdoc生成機能。その書式にしたがってコーディングするくせをつけたいものです。http://symfoware.blog68.fc2.com/blog-entry-884.html

python の += はextend

まずは、これを見て http://stackoverflow.com/questions/2347265/what-does-plus-equals-do-in-python抜粋させていただきました。 l += [3]ではobjectは変わってないのがわかりますね。 l = l+[3]だと、extendではなく、あらたなobjectを生成してるのが分か…

__slots__の使い道

まずはpython リファレンスでの__slots__の説明 3.4.2.4. __slots__By default, instances of both old and new-style classes have a dictionary for attribute storage. This wastes space for objects having very few instance variables. The space con…

Profiler

I found that profiler in python is very handy and easy to use! python profiler in interactive mode

TypeError: super(type, obj): obj must be an instance or subtype of type

TypeError: super(type, obj): obj must be an instance or subtype of typesuper(SubClass, self).foo()文法はあっているのに、TypeErrorが表示されてこまりました。昨日は此れで動いていたし。まぁ、それからいくらか修正加えたから、それが影響してるのか…