package org.cafebabepy.runtime.object;

import org.cafebabepy.runtime.Python;

/**
 * Created by yotchang4s on 2017/06/19.
 */
public class PyIntObject extends AbstractPyObjectObject {

    // FIXME CPythonのsys.maxsizeに対応する
    private final int value;

    public PyIntObject(Python runtime, int value) {
        super(runtime, runtime.typeOrThrow("builtins.int"));

        this.value = value;
    }

    public int getIntValue() {
        return this.value;
    }

    public PyIntObject add(PyIntObject other) {
        return new PyIntObject(this.runtime, this.value + other.value);
    }

    public PyIntObject sub(PyIntObject other) {
        return new PyIntObject(this.runtime, this.value - other.value);
    }

    @Override
    public String asJavaString() {
        return String.valueOf(this.value);
    }
}

@@ -524,32 +524,16 @@
  return 
-new PyIntObject(
 this.run
@@ -528,34 +528,40 @@
 urn this.runtime
-, 
+.number(
 this.value + oth
@@ -645,24 +645,8 @@
 urn 
-new PyIntObject(
 this
@@ -653,18 +653,24 @@
 .runtime
-, 
+.number(
 this.val

Change new object method