micropython

tests/call_func_default_redefine.py

223:09ae448806d1
2009-05-24 Paul Boddie Added a StoreAddressContext instruction for class attribute initialisation. Fixed the mechanism behind LoadAttrIndexContextCond and LoadAddressContextCond since it failed to provide the appropriate instance context for instance accesses. Added a LoadFunction instruction in order to distinguish between constants which have no context information and those which do.
     1 #!/usr/bin/env python     2      3 def f(a, b, c=4):     4     return c     5      6 g = f     7 r1 = g(1, c=3, b=2) # -> 3     8 r2 = g(1, 2)        # -> 4     9     10 def g(a, c, b=5):    11     return b    12     13 r3 = g(1, c=3, b=2) # -> 2    14 r4 = g(1, 3)        # -> 5    15     16 # vim: tabstop=4 expandtab shiftwidth=4