tests/call_func_default_class_attribute.py | raw changeset files shortlog |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tests/call_func_default_class_attribute.py Sun Sep 05 02:20:05 2010 +0200 1.3 @@ -0,0 +1,14 @@ 1.4 +#!/usr/bin/env python 1.5 + 1.6 +class C: 1.7 + 1.8 + default = 101 1.9 + 1.10 + def f(self, x=default): 1.11 + return x 1.12 + 1.13 +c = C() 1.14 +result_101 = c.f() 1.15 +result_202 = c.f(202) 1.16 + 1.17 +# vim: tabstop=4 expandtab shiftwidth=4