Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Last active December 21, 2015 16:49
Show Gist options
  • Save jonathanmarvens/6336197 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/6336197 to your computer and use it in GitHub Desktop.
def __constructor(*arguments, **keyword_arguments):
current_instance = arguments[0]
current_class = eval(current_instance.__class__.__name__)
parent_class = super(current_class, current_instance)
parent_class.__init__(*arguments[1:], **keyword_arguments)
__members = {
"__init__": __constructor,
}
Float = type(
"Float",
(float, ),
__members
)
Integer = type(
"Integer",
(int, ),
__members
)
Object = type(
"Object",
(object, ),
__members
)
String = type(
"String",
(str, ),
__members
)
Type = type(
"Type",
(type, ),
__members
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment