Top Description Inners Fields Constructors Methods
org.python.core

public Class Py

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandle, .MethodHandles, java.math.BigInteger

Common run-time constants and constructors.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv static final Object[]
EMPTY_ARRAY

Empty (zero-length) array of Object.

pack-priv static final String[]
EMPTY_STRING_ARRAY

Empty (zero-length) array of String.

public static final Boolean
False

Python False object.

public static final Object
None

Python None object.

pack-priv static final Object
NotImplemented

Python NotImplemented object.

public static final Boolean
True

Python True object.

Constructor Summary

AccessConstructor and Description
public
Py()

Method Summary

Modifier and TypeMethod and Description
pack-priv static String

Returns:

a string representation
defaultToString
(Object
object to represent
o
)

Convenient default toString implementation that tries __str__, if defined, but always falls back to something.

public static PyDict

Returns:

dict()
dict
()

Return empty Python dict.

pack-priv static synchronized void
finalise()

Action we might need to finalise the run-time system.

pack-priv static int

Returns:

the Python id(o)
id
(Object
the object
o
)

Return the unique numerical identiy of a given Python object.

pack-priv static synchronized void
initialise()

Action we might need to initialise the run-time system.

pack-priv static PyBaseObject

Returns:

object()
object
()

Return a Python object.

public static PyTuple

Returns:

equivalent tuple object
tuple
(Object...
to contain
values
)

Return Python tuple for array of Object.

public static Integer

Returns:

equivalent int
val
(int
to represent
value
)

Deprecated Use primitive auto-boxed or Integer.valueOf.
Return Python int for Java int.
public static BigInteger

Returns:

equivalent int
val
(long
to represent
value
)

Return Python int for Java long.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_ARRAYback to summary
pack-priv static final Object[] EMPTY_ARRAY

Empty (zero-length) array of Object.

EMPTY_STRING_ARRAYback to summary
pack-priv static final String[] EMPTY_STRING_ARRAY

Empty (zero-length) array of String.

Falseback to summary
public static final Boolean False

Python False object.

Noneback to summary
public static final Object None

Python None object.

NotImplementedback to summary
pack-priv static final Object NotImplemented

Python NotImplemented object.

Trueback to summary
public static final Boolean True

Python True object.

Constructor Detail

Pyback to summary
public Py()

Method Detail

defaultToStringback to summary
pack-priv static String defaultToString(Object o)

Convenient default toString implementation that tries __str__, if defined, but always falls back to something. Use as:

public String toString() { return Py.defaultToString(this); }
Parameters
o:Object

object to represent

Returns:String

a string representation

dictback to summary
public static PyDict dict()

Return empty Python dict.

Returns:PyDict

dict()

finaliseback to summary
pack-priv static synchronized void finalise()

Action we might need to finalise the run-time system.

idback to summary
pack-priv static int id(Object o)

Return the unique numerical identiy of a given Python object. Objects with the same id() are identical as long as both exist. By implementing it here, we encapsulate the problem of qualified type name and what "address" or "identity" should mean.

Parameters
o:Object

the object

Returns:int

the Python id(o)

initialiseback to summary
pack-priv static synchronized void initialise()

Action we might need to initialise the run-time system.

objectback to summary
pack-priv static PyBaseObject object()

Return a Python object.

Returns:PyBaseObject

object()

tupleback to summary
public static PyTuple tuple(Object... values)

Return Python tuple for array of Object.

Parameters
values:Object[]

to contain

Returns:PyTuple

equivalent tuple object

valback to summary
public static Integer val(int value)

Deprecated

Use primitive auto-boxed or Integer.valueOf.

Return Python int for Java int.

Parameters
value:int

to represent

Returns:Integer

equivalent int

Annotations
@Deprecated
valback to summary
public static BigInteger val(long value)

Return Python int for Java long.

Parameters
value:long

to represent

Returns:BigInteger

equivalent int

org.python.core back to summary

private Class Py.Singleton

extends Object
implements CraftedPyObject
Class Inheritance
All Implemented Interfaces
org.python.core.CraftedPyObject

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv final PyType

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public PyType
getType()

Implements org.python.core.CraftedPyObject.getType.

The Python type of this object.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
pack-priv String name
typeback to summary
pack-priv final PyType type

Constructor Detail

Singletonback to summary
pack-priv Singleton(String name)

Method Detail

getTypeback to summary
public PyType getType()

Implements org.python.core.CraftedPyObject.getType.

Doc from org.python.core.CraftedPyObject.getType.

The Python type of this object.

Returns:PyType

type of this object

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override