MMpy.set_api_version

Syntax

MMpy.set_api_version(major, minor, micro)

Description

Sets the MMpy API version for the script session.

Parameters

Name
Type
Description

major

int Major API version to use.

minor

int Minor API version to use.
micro int Micro API version to use.

Notes

This function is provided to scripts to ensure better forwards compatibility with future versions of the application.

In order to provide improved Python interfaces, the application may sometimes be forced to break API compatibility with existing scripts. While these events will be rare, this can happen.

Using this function sets the Python environment up to provide compatibility support for older APIs, so that existing scripts can still run.


The API versioning follows accepted Python community practices, as described here: https://www.python.org/dev/peps/pep-0440/ and https://semver.org/.

In essence, the versioning scheme follows the following pattern: "major.minor.micro", where an increment of the major version number denotes a breaking API change.


By default, if there is no call to this made (eg: for pre v2020 recorded scripts), the major API version will be considered as v1.0.0.


Scripts recorded in v2020 onward will automatically insert this as the first line executed in the script.

Examples

MMpy.set_api_version(1, 0, 0)

Resource ID

IDPH_SET_API_VERSION