1.1 --- a/common.py Sat Oct 08 00:33:32 2016 +0200
1.2 +++ b/common.py Sat Oct 08 00:34:34 2016 +0200
1.3 @@ -811,6 +811,21 @@
1.4 else:
1.5 return "%s.%s" % (path, name)
1.6
1.7 +# Type deduction for usage.
1.8 +
1.9 +def get_types_for_usage(attrnames, objects):
1.10 +
1.11 + """
1.12 + Identify the types that can support the given 'attrnames', using the
1.13 + given 'objects' as the catalogue of type details.
1.14 + """
1.15 +
1.16 + types = []
1.17 + for name, _attrnames in objects.items():
1.18 + if set(attrnames).issubset(_attrnames):
1.19 + types.append(name)
1.20 + return types
1.21 +
1.22 # Useful data.
1.23
1.24 predefined_constants = "False", "None", "NotImplemented", "True"