1.1 --- a/micropython/data.py Sun May 31 18:44:40 2009 +0200
1.2 +++ b/micropython/data.py Mon Jun 01 02:41:57 2009 +0200
1.3 @@ -899,6 +899,11 @@
1.4 self.astnode = node
1.5 self.referenced = 0
1.6
1.7 + # For lambda functions with defaults, add a context argument.
1.8 +
1.9 + if name is None and defaults:
1.10 + self.argnames.insert(0, "<context>")
1.11 +
1.12 # Initialise the positional names.
1.13
1.14 self.positional_names = self.argnames[:]
1.15 @@ -970,7 +975,7 @@
1.16 objtable.get_index("__builtins__.function"), # is instance
1.17 self.code_location,
1.18 "__builtins__.function",
1.19 - len(self.defaults) + 1, # size
1.20 + len(self.defaults) + 1, # size (not accurate for lambda functions before instantiation)
1.21 paramtable.as_list().get_code(self.full_name()) # funccode
1.22 )
1.23 ]