class Point( object ):
__slots__ = ( "x", "y" )
def __init__( self, x, y ):
self.x = x
self.y = y
p1 = Point( 3, 6 )
import sys
p2 = getattr( sys.modules[__name__], "Point" )( 3, 6 )
### unsafe
p3 = eval( "{}( {}, {} )".format( "Point", 3, 6 ) )
p4 = globals()["Point"]( 3, 6 )
### prototype
import copy
p5 = copy.deepcopy( p4 )
p5.x = 100
p5.y = 100
p6 = p1.__class__( 3, 6 )