1.1 --- a/micropython/__init__.py Sat Apr 26 02:31:44 2008 +0200
1.2 +++ b/micropython/__init__.py Sat Apr 26 18:35:18 2008 +0200
1.3 @@ -229,6 +229,9 @@
1.4
1.5 if self.paramtable is None:
1.6 t = self.paramtable = micropython.table.Table()
1.7 +
1.8 + # Visit each module, getting function and method details.
1.9 +
1.10 for module in self.get_modules():
1.11 for obj in module.all_objects:
1.12 if isinstance(obj, micropython.inspect.Function):
1.13 @@ -241,6 +244,21 @@
1.14 elif isinstance(obj, micropython.inspect.Class):
1.15 t.add(obj.full_name(), obj.get_instantiator().parameters())
1.16
1.17 + # Filter out all parameter table entries not referenced by keyword
1.18 + # arguments.
1.19 +
1.20 + keyword_names = set()
1.21 +
1.22 + for module in self.get_modules():
1.23 + keyword_names.update(module.keyword_names)
1.24 +
1.25 + for function_name, parameters in t.table.items():
1.26 + for name in parameters.keys():
1.27 + if name in keyword_names:
1.28 + break
1.29 + else:
1.30 + del t.table[function_name]
1.31 +
1.32 return self.paramtable
1.33
1.34 # Import methods.