# HG changeset patch # User Paul Boddie # Date 1385683385 -3600 # Node ID fa8e296dafdfa3fb0544240c04a9b58926ad52a6 # Parent 82c79d294ea62c861eeda50be069f0011c9eefcd Added an example of a method with an uncertain default parameter value. diff -r 82c79d294ea6 -r fa8e296dafdf tests/call_func_default_class_attribute_uncertain.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/call_func_default_class_attribute_uncertain.py Fri Nov 29 01:03:05 2013 +0100 @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +switch = 0 + +class C: + + if switch: + default = 100 + else: + default = 101 + + def f(self, x=default): + return x + +c = C() +result_101 = c.f() +result_202 = c.f(202) + +# vim: tabstop=4 expandtab shiftwidth=4