7.11 Assertions
The assert command can be used to assert that a logical expression, such as x>0, is true. An error is reported if the expression is false, and optionally a string can be supplied to provide a more informative error message to the user:
assert x>0
assert y<0 "y must be less than zero."
The assert command can also be used to test the version number of Pyxplot. It is possible to test either that the version is newer than or equal to a specific version, using the = operator, or that it is older than a specific version, using the operator, as demonstrated in the following examples:
assert version >= 0.8.2
assert version < 0.8 "This script is designed for Pyxplot 0.7"