Compatibility module for Python 2.7 and >= 3.4

This module provides a set of utility types and functions for optimization and to aid in writing Python 2/3 compatibile code.

kivy.compat.PY2 = False

False, because we don’t support Python 2 anymore.

kivy.compat.clock() → float

A clock with the highest available resolution on your current Operating System.

kivy.compat.string_types

alias of builtins.str

kivy.compat.isclose()

Determine whether two floating point numbers are close in value.

rel_tol
maximum difference for being considered “close”, relative to the magnitude of the input values
abs_tol
maximum difference for being considered “close”, regardless of the magnitude of the input values

Return True if a is close in value to b, and False otherwise.

For the values to be considered close, the difference between them must be smaller than at least one of the tolerances.

-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is not close to anything, even itself. inf and -inf are only close to themselves.