1.1 --- a/docs/concepts.txt Sat May 09 01:45:42 2009 +0200
1.2 +++ b/docs/concepts.txt Sat May 09 02:54:18 2009 +0200
1.3 @@ -228,11 +228,6 @@
1.4 attributes in the structure correspond to the default arguments for each
1.5 function, if any.
1.6
1.7 -The two kinds of structure attribute should be accommodated by both groups of
1.8 -objects, since without a default argument section, classes and instances may
1.9 -not employ default arguments in their respective instantiator/__init__ and
1.10 -__call__ methods.
1.11 -
1.12 Structure Types
1.13 ---------------
1.14
2.1 --- a/tests/call_func_default_dynamic.py Sat May 09 01:45:42 2009 +0200
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,12 +0,0 @@
2.4 -#!/usr/bin/env python
2.5 -
2.6 -def f(a, b, c):
2.7 - return c
2.8 -
2.9 -def h(a, b, c=f(1, 2, 3)):
2.10 - return c
2.11 -
2.12 -h(1, 2, 3)
2.13 -h(1, 2)
2.14 -
2.15 -# vim: tabstop=4 expandtab shiftwidth=4
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/tests/call_func_default_non_constant.py Sat May 09 02:54:18 2009 +0200
3.3 @@ -0,0 +1,12 @@
3.4 +#!/usr/bin/env python
3.5 +
3.6 +def f(a, b, c):
3.7 + return b
3.8 +
3.9 +def h(a, b, c=f(5, 4, 3)):
3.10 + return c
3.11 +
3.12 +x = h(1, 2, 3) # -> 3
3.13 +y = h(1, 2) # -> 4
3.14 +
3.15 +# vim: tabstop=4 expandtab shiftwidth=4
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/tests/class_init_defaults.py Sat May 09 02:54:18 2009 +0200
4.3 @@ -0,0 +1,11 @@
4.4 +#!/usr/bin/env python
4.5 +
4.6 +class C:
4.7 + def __init__(self, x=1, y=2, z=3):
4.8 + self.x = x
4.9 + self.y = y
4.10 + self.z = z
4.11 +
4.12 +c = C()
4.13 +
4.14 +# vim: tabstop=4 expandtab shiftwidth=4