13 List of data types

The following is a list of Pyxplot’s data types:

  • boolean

  • color

  • date

  • dictionary

  • exception

  • fileHandle

  • function

  • instance

  • list

  • matrix

  • module

  • null

  • number

  • string

  • type

  • vector

Each of these data types has a prototype object in the module types, which can be called like a function to create a new object of the type. See Section 12.11 for details of the arguments accepted by each prototype.

All objects in Pyxplot have methods that can be called on them, using the generic syntax:

object.methodName(arguments)

Some methods are common to all objects. For example, all objects have a method str() which produces a string representation of the object, as used by the print command. They also all have a methods() method, which returns a list of the names of all of the methods available for the object. For example:

pyxplot> pi.type()
$<$data type: number$>$
pyxplot> "hello world".methods
methods() returns a list of the methods of an object.
pyxplot> [3,2,1].len()
3
pyxplot> time.fromCalendar(2000,1,1,0,0,0).toUnix()
946684800

As the above examples show, printing a method object returns brief documentation about it. The sections below list the methods of each data type.