Never been to DZone Snippets before? Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world From Alex's recipe. 1 2 # Put in const.py...: 3 class _const: 4 class ConstError(TypeError): pass 5 def __setattr__(self,name,value): 6 if self.__dict__.has_key(name): 7 raise self.ConstErr
パッチを書きました。 Python 2.6.5 (r265:79063, 魔改造, May 2 2010, 17:41:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def a(): ... readonly a = b = 3 ... a = 3 ... File "<stdin>", line 3 SyntaxError: variable 'a' is read-only >>> def a(): ... x = 3 ... readonly x = 3 ... File "<stdin>", line 3 SyntaxError: name 'x' is assigned to b
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く