Source

puffin / objects / src / int.winxed

Full commit
namespace Python {

function int(type, object) {
    var f = type.__new__;
    var i = f(type, 'int', [object]);

    i.__new__ = function(cls, int value[optional]) {
        var n = new Python.instance;
        n.__class__ = cls;
        n.__value__ = value;

        return n;
    };

    i.__repr__ = function(obj) {
        return string(obj.__value__);
    };

    i.__str__ = i.__repr__;

    i.__add__ = function(obj, other) {
        var result = obj.__value__ + other.__value__;
        var f = obj.__new__;
        return f(obj.__class__, result);
    };

    return i;
}

}