1.1 --- a/common.py Sat Dec 10 14:04:01 2016 +0100
1.2 +++ b/common.py Sat Dec 10 17:32:16 2016 +0100
1.3 @@ -915,6 +915,22 @@
1.4 assigned.append(attrname)
1.5 return assigned
1.6
1.7 +# Type and module functions.
1.8 +
1.9 +def get_builtin_module(name):
1.10 +
1.11 + "Return the module name containing the given type 'name'."
1.12 +
1.13 + # NOTE: This makes assumptions about the __builtins__ structure.
1.14 +
1.15 + return name == "string" and "str" or name == "NoneType" and "none" or name
1.16 +
1.17 +def get_builtin_type(name):
1.18 +
1.19 + "Return the type name provided by the given Python value 'name'."
1.20 +
1.21 + return name == "str" and "string" or name
1.22 +
1.23 # Useful data.
1.24
1.25 predefined_constants = "False", "None", "NotImplemented", "True"