Skip to content

Instantly share code, notes, and snippets.

@freakboy3742
Created December 17, 2015 11:04
Show Gist options
  • Save freakboy3742/03f8cbd63559d9c89330 to your computer and use it in GitHub Desktop.
Save freakboy3742/03f8cbd63559d9c89330 to your computer and use it in GitHub Desktop.
Why I like Python, volume 3742
package org.python.java;
public class Object extends org.python.types.Object {
static
// public static org.python.Object convert(java.lang.Object java) {
// if (java instanceof java.lang.String) {
// return new org.python.types.Str((java.lang.String) java);
// } else {
// return new org.python.java.Object(java);
// }
// }
public java.lang.Object object;
public int hashCode() {
return this.object.hashCode();
}
public java.lang.Object toJava() {
return this.object;
}
public java.lang.Object toObject() {
return this.object;
}
public Object(java.lang.Object object) {
this(org.python.types.Type.Origin.JAVA, object);
}
public Object(org.python.types.Type.Origin origin, java.lang.Object object) {
super(origin, object.getClass());
this.object = object;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment