Basic Objects

There are a few things that every best object needs to do. Most importantly we would like to be able to recognize that they are indeede best objects. In addition, we want them to have a name that can be assinged at will and to be able to give a string representation of themselves. These requirements are met by forcing every object in best to be a child of the class best.Object:

class best.Object
Inherits :object

A class that all best objects should inherit.

__init__([name='Best Object'])

Initialize the object.

Parameters:name (str) – A name for the object.
name

Get/set the name of the object.

_to_string(pad)

Return a string representation of the object padding the beginning with pad.

This can and should be overloaded by children.

Parameters:pad (str) – The padding we will use.
Returns:A string representation of the object.
Return type:str
__str__()

Return a string representation of the object. It is equivalent to calling self._to_string('').

Previous topic

Core

Next topic

Miscellaneous

This Page