object
object: all Python objects by default
inherit its Python method implementations. The canonical
implementation of object
is Object
. This class
provides its Python behaviours.
Although all Python objects are sub-classes in Python of
object
, their implementation classes will not generally
be sub-classes in Java of this one. In particular, many built-in
types are not.
The Java implementation class of a type defined in Python will be
derived from the canonical implementation class of the "solid
base" it inherits in Python. This may be object
,
in which case the implementation class will be a sub-class in
Java of this class.
Implementation Note
All exposed methods, special methods and attribute get,
set and delete methods defined here must be declared
static
in Java, with an explicit Object self
argument. (__new__
is excepted from this rule as it
is static
anyway.) This is so that methods defined
here on object
operate correctly on receiving Python
objects whatever their Java class. Methods and fields must be
package visible so that PyType
is able to form
MethodHandle
s to them using its default lookup
object.
Modifier and Type | Field and Description |
---|---|
public static final PyType | TYPE
The type object of |
Access | Constructor and Description |
---|---|
protected | PyBaseObject(PyType
actual Python sub-class being created type)Constructor for Python sub-class specifying |
public |
Modifier and Type | Method and Description |
---|---|
pack-priv static void | __delattr__(Object
the target of the delete obj, String of the attribute name)
|
pack-priv static Object | Returns: attribute valuethe target of the get obj, String of the attribute name)
|
pack-priv static Object | Returns: string formtarget of the operation self)
|
pack-priv static void | __setattr__(Object
the target of the set obj, String of the attribute name, Object to give the attribute value)
|
pack-priv static Object | Returns: string formtarget of the operation self)
|
TYPE | back to summary |
---|---|
public static final PyType TYPE The type object of |
PyBaseObject | back to summary |
---|---|
protected PyBaseObject(PyType type) Constructor for Python sub-class specifying
|
PyBaseObject | back to summary |
---|---|
public PyBaseObject() Constructor for |
__delattr__ | back to summary |
---|---|
pack-priv static void __delattr__(Object obj, String name) throws AttributeError, Throwable
AttributeError , this is definitive and the
instance dictionary (if any) will not be updated.
|
__getattribute__ | back to summary |
---|---|
pack-priv static Object __getattribute__(Object obj, String name) throws AttributeError, Throwable
AttributeError , the instance dictionary (if
any) will be consulted, and the subsequent cases (3 and 4)
skipped. A non-data descriptor that throws an
AttributeError (case 3) causes case 4 to be skipped.
|
__repr__ | back to summary |
---|---|
pack-priv static Object __repr__(Object self)
|
__setattr__ | back to summary |
---|---|
pack-priv static void __setattr__(Object obj, String name, Object value) throws AttributeError, Throwable
AttributeError , this is definitive and the
instance dictionary (if any) will not be updated.
|
__str__ | back to summary |
---|---|
pack-priv static Object __str__(Object self)
|