Compatibility module for Python 2.7 and > 3.3¶
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
= True¶ True if this version of python is 2.x.
-
kivy.compat.
clock
() → floating point number¶ A clock with the highest available resolution on your current Operating System.
-
kivy.compat.
string_types
¶ A utility type for detecting string in a Python 2/3 friendly way. For example:
if isinstance(s, string_types): print("It's a string or unicode type") else: print("It's something else.")
alias of
basestring
-
kivy.compat.
isclose
(a, b, rel_tol=1e-09, abs_tol=0.0)¶ Measures whether two floats are “close” to each other. Identical to https://docs.python.org/3.6/library/math.html#math.isclose, for older versions of python.