Class: object

Sk.builtin.object() → {Sk.builtin.object}

new object() → {Sk.builtin.object}

Constructor for Python object. All Python classes (builtin and user-defined) should inherit from this class.

Source:
Returns:

Python object

Type
Sk.builtin.object

Members

(static) pythonFunctions :Array

Array of all the Python functions which are methods of this class.

Type:
  • Array
Source:

$r

Return the string representation of this instance.

Javascript function, returns Python object.

Source:

__eq__

Python wrapper for __eq__ method.

Source:

__ge__

Python wrapper for __ge__ method.

Source:

__gt__

Python wrapper for __gt__ method.

Source:

__hash__

Python wrapper for __hash__ method.

Source:

__le__

Python wrapper for __le__ method.

Source:

__lt__

Python wrapper for __lt__ method.

Source:

__ne__

Python wrapper for __ne__ method.

Source:

__new__

Default implementation of new just calls the class constructor

Source:

__repr__

Python wrapper for __repr__ method.

Source:

__str__

Python wrapper for __str__ method.

Source:

ob$type :Sk.builtin.type|Object

The type object of this class.

Type:
  • Sk.builtin.type | Object
Source:

tp$name :string

The name of this class.

Type:
  • string
Source:

Methods

GenericGetAttr(pyName, canSuspendopt) → {undefined}

Get an attribute

Parameters:
Name Type Attributes Description
pyName Object

Python string name of the attribute

canSuspend boolean <optional>

Can we return a suspension?

Source:
Returns:
Type
undefined

GenericSetAttr(pyName, value, canSuspendopt) → {undefined}

Parameters:
Name Type Attributes Description
pyName Object
value Object
canSuspend boolean <optional>
Source:
Returns:
Type
undefined

ob$eq(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Perform equality check between this instance and a Python object (i.e. this == other).

Implements __eq__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to check for equality.

Source:
Returns:

true if equal, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

ob$ge(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Determine if this instance is greater than or equal to a Python object (i.e. this >= other).

Implements __ge__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to compare.

Source:
Returns:

true if this >= other, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

ob$gt(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Determine if this instance is greater than a Python object (i.e. this > other).

Implements __gt__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to compare.

Source:
Returns:

true if this > other, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

ob$le(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Determine if this instance is less than or equal to a Python object (i.e. this <= other).

Implements __le__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to compare.

Source:
Returns:

true if this <= other, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

ob$lt(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Determine if this instance is less than a Python object (i.e. this < other).

Implements __lt__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to compare.

Source:
Returns:

true if this < other, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

ob$ne(other) → {Sk.builtin.bool|Sk.builtin.NotImplemented}

Perform non-equality check between this instance and a Python object (i.e. this != other).

Implements __ne__ dunder method.

Javascript function, returns Python object.

Parameters:
Name Type Description
other Object

The Python object to check for non-equality.

Source:
Returns:

true if not equal, false otherwise

Type
Sk.builtin.bool | Sk.builtin.NotImplemented

tp$hash() → {Sk.builtin.int_}

Return the hash value of this instance.

Javascript function, returns Python object.

Source:
Returns:

The hash value

Type
Sk.builtin.int_