Skip to main content

Comparable.<=

<=that

Group: Operators
Aliases: less than or equal

Documentation​

Checks if self is less than or equal to that.

To have <= defined, a type must define both < and ==.

Arguments​

  • that: The value to compare self against.

Examples​

Checking if the variable a is less than or equal to 147.​

      from Standard.Base import all

example_less_eq =
a = 7 * 21
a < 147

Remarks​

Implementing Less Than or Equal​

While it is often possible to implement a more efficient version of this operation for complex types, care must be taken to ensure that your implementation is semantically equivalent to the disjunction of the less than than and equal to operations.