# HG changeset patch # User Paul Boddie # Date 1352068866 -3600 # Node ID a61f326ec2b2ecf19f35ffcf4e74bc893658d5b5 # Parent 255903924256a7602f0b7e0cd50f384587e24344 Fixed acquisition of the pre-made type class for __class__ attributes. diff -r 255903924256 -r a61f326ec2b2 micropython/data.py --- a/micropython/data.py Sun Nov 04 23:31:22 2012 +0100 +++ b/micropython/data.py Sun Nov 04 23:41:06 2012 +0100 @@ -2151,6 +2151,9 @@ "type" : Class("type"), } +def get_constant_class(name): + return premade[name] + # Class construction. def get_class(name, parent, module, node): diff -r 255903924256 -r a61f326ec2b2 micropython/inspect.py --- a/micropython/inspect.py Sun Nov 04 23:31:22 2012 +0100 +++ b/micropython/inspect.py Sun Nov 04 23:41:06 2012 +0100 @@ -669,7 +669,7 @@ # Check for class.__class__. if attrname == "__class__" and isinstance(value, Class): - attr = type_class + attr = get_constant_class("type") else: attr = value.get(attrname) or make_instance() self.use_specific_attribute(value.full_name(), attrname)