micropython

tests/op_add_default.py

233:8abc113da24c
2009-06-01 Paul Boddie Fixed StoreCallable using a new DataObject method which replaces the address of the callable. Made a cmd module to handle common compilation and processing activities. Renamed MakeObject to MakeInstance. Changed FillDefaults to use the current value as a reference to the container holding the defaults. Removed the extra temporary storage slot previously used when adjusting frames. Changed lambda functions to use a context parameter, changing the image to not reserve space for defaults immediately after the header of such functions. Added notes about the issues with positioning keyword arguments. Expanded and improved the tests.
     1 #!/usr/bin/env python     2      3 def f(a, b, c=a+b):     4     return a + b + c     5      6 a = 10 # used in f default     7 b = 20 # used in f default     8 x = f(1, 2)     9     10 # vim: tabstop=4 expandtab shiftwidth=4