Object#

class Object(*args, **kwargs)[source]#

Bases: Sequence

Abstract base class for syntactical objects.

An Object consists of a tuple of arguments args together with a dictionary of annotations annotations.

Parameters:
  • args – Arguments

  • kwargs – Annotations.

Returns:

Object.

Testing and checking#

Object.test(arg)

Tests whether arg is an instance of this class.

Object.check(arg[, func_name, arg_name, ...])

Checks whether arg is an instance of this class.

See more object methods for variants of the above.

Unfolding and unpacking#

Object.unfold(arg)

Unfolds arg's arguments.

Object.unfold_unsafe(arg)

Unfolds arg's arguments (unsafe version).

Object.unpack(arg)

Unpacks arg's arguments.

Object.unpack_unsafe(arg)

Unpacks arg's arguments (unsafe version).

See more object methods for variants of the above.

Arguments and annotations#

Object.args

Object arguments.

Object.get_args()

Gets object arguments.

Object.annotations

Object annotations.

Object.get_annotations()

Gets object annotations.

Comparison#

Object.compare(other)

Compares object to other.

Object.equal(other[, deep])

Tests whether object is equal to other.

Object.deepequal(other)

Tests whether object is deep-equal to other.

Copying#

Object.copy(*args, **kwargs)

Makes a shallow copy of object.

Object.with_args(*args)

Shallow-copies object overwriting its arguments.

Object.with_annotations(**kwargs)

Shallow-copies object overwriting its annotations.

Object.deepcopy()

Makes a deep copy of object.

Debugging#

Object.hexdigest

Object hexadecimal digest.

Object.get_hexdigest()

Gets object hexadecimal digest.

Object.dump()

Gets a raw string representation of object.