1.1 --- a/micropython/__init__.py Sun Jun 07 20:04:16 2009 +0200
1.2 +++ b/micropython/__init__.py Sun Jun 07 21:17:59 2009 +0200
1.3 @@ -144,7 +144,7 @@
1.4
1.5 # Omit built-in function code where requested.
1.6
1.7 - if suppress_builtins:
1.8 + if suppress_builtins and not obj.astnode.doc is not None:
1.9 continue
1.10
1.11 # Generate the instantiator/initialiser.
1.12 @@ -175,7 +175,7 @@
1.13
1.14 # Omit built-in function code where requested.
1.15
1.16 - if suppress_builtins:
1.17 + if suppress_builtins and not obj.astnode.doc is not None:
1.18 pass
1.19
1.20 # Append the function code to the image.
1.21 @@ -256,7 +256,7 @@
1.22 # Set the code location only where the code has been
1.23 # generated.
1.24
1.25 - if not with_builtins and item.module.name == "__builtins__":
1.26 + if not with_builtins and item.module.name == "__builtins__" and item.astnode.doc is None:
1.27 item.code_location = item.full_name()
1.28
1.29 # Skip any defaults for named functions.
1.30 @@ -298,7 +298,8 @@
1.31
1.32 elif isinstance(item, micropython.data.Class):
1.33 assert item.instance_template_location == len(self.raw_code)
1.34 - self.raw_code += item.as_raw(objtable, paramtable, with_builtins or item.module.name != "__builtins__")
1.35 + self.raw_code += item.as_raw(objtable, paramtable,
1.36 + with_builtins or item.module.name != "__builtins__" or item.astnode.doc is not None)
1.37 assert item.location == len(self.raw_code) - 1
1.38
1.39 elif isinstance(item, micropython.data.Const):
1.40 @@ -311,7 +312,7 @@
1.41
1.42 # Check the code location only where the code has been generated.
1.43
1.44 - assert (not with_builtins and item.module.name == "__builtins__") or \
1.45 + assert (not with_builtins and item.module.name == "__builtins__" and item.astnode.doc is None) or \
1.46 item.name is not None and item.code_location == len(self.raw_code) + len(item.defaults) or \
1.47 item.name is None and item.code_location == len(self.raw_code)
1.48