VersionMeta#

class ansys.tools.common.versioning.VersionMeta#

Provides a metaclass for version comparison.

Implements modifications to magic methods.

Overview#

__le__

Less equal.

__lt__

Less than.

__ge__

Greater equal.

__gt__

Greater than.

__eq__

Equal method.

__ne__

Not equal.

__hash__

Call the underlying __hash__ method.

Import detail#

from ansys.tools.common.versioning import VersionMeta

Method detail#

VersionMeta.__le__(__x: str | int) bool#

Less equal.

If compared against a string that contains dev, it always evaluates to True. If compared against an integer, it performs a classic ‘less equal’ operation.

VersionMeta.__lt__(__x: str | int) bool#

Less than.

If compared against a string which contains dev, it always evaluates to True. If compared against an integer, it performs a classic ‘less than’ operation.

VersionMeta.__ge__(__x: str | int) bool#

Greater equal.

If compared against a string that contains dev, it always evaluates to False. If compared against an integer, it performs a classic ‘greater equal’ operation.

VersionMeta.__gt__(__x: str | int) bool#

Greater than.

If compared against a string that contains dev, it always evaluates to False. If compared against an integer, it performs a classic ‘greater than’ operation.

VersionMeta.__eq__(__x: object) bool#

Equal method.

If compared against a string that contains ‘’dev``, it always evaluates to False. If compared against an integer, it performs a classic ‘equal’ operation.

VersionMeta.__ne__(__x: object) bool#

Not equal.

If compared against a string that contains dev, it always evaluates to not ‘equal’ operation (True). If compared against an integer, it performs a classic ‘not equal’ operation.

VersionMeta.__hash__() int#

Call the underlying __hash__ method.