示例#1
0
文件: Super.java 项目: yoongkang/voc
  public org.python.Object __getattribute_null(java.lang.String name) {
    // Look for local instance attributes first
    // org.Python.debug("SUPER GETATTRIBUTE ", name);

    // Look to the class for a super-proxy attribute
    org.python.Object value = this.klass.__getattribute_null(name + "$super");

    // If no super proxy exists, check the base class.
    if (value == null) {
      // org.Python.debug("no instance attributes on super;");
      // org.Python.debug("    look to super of ", this.klass);
      // org.Python.debug("    which is ", this.klass.__base__);
      value = this.klass.__base__.__getattribute_null(name);
    }
    if (value == null) {
      throw new org.python.exceptions.NotImplementedError("Can't get attributes on super() (yet!)");
    }

    // org.Python.debug("SUPER GETATTRIBUTE " + name, value);
    // org.Python.debug("INSTANCE  ", this.instance);
    // Post-process the value retrieved, using the binding fr
    return value.__get__(this.instance, this.klass);
  }