### Navigation

- index
- modules |
- next |
- previous |
- PySDL2 0.9.2 documentation »
- API reference »
- sdl2.ext - Python extensions for SDL2 »

# sdl2.ext.compat - Python compatibility helpers

The `sdl2.ext.compat` module is for internal purposes of the `sdl2` package and should not be used outside of the package. Classes, methods and interfaces might change between versions and there is no guarantee of API compatibility on different platforms and python implementations or between releases.

`sdl2.ext.compat.``ISPYTHON2`

  `True`, if executed in a Python 2.x compatible interpreter, `False` otherwise.

`sdl2.ext.compat.``ISPYTHON3`

  `True`, if executed in a Python 3.x compatible interpreter, `False` otherwise.

`sdl2.ext.compat.``long`([x[, base]])

  Note

  Only defined for Python 3.x, for which it is the same as `int()`.

`sdl2.ext.compat.``unichr`(i)

  Note

  Only defined for Python 3.x, for which it is the same as `chr()`.

`sdl2.ext.compat.``callable`(x) → bool

  Note

  Only defined for Python 3.x, for which it is the same as `isinstance(x, collections.Callable)`

`sdl2.ext.compat.``byteify`(x : string, enc : string) → bytes

  Converts a string to a `bytes()` object.

`sdl2.ext.compat.``stringify`(x : bytes, enc : string) → string

  Converts a `bytes()` to a string object.

`sdl2.ext.compat.``isiterable`(x) → bool

  Shortcut for `isinstance(x, collections.Iterable)`.

`sdl2.ext.compat.``platform_is_64bit`() → bool

  Checks, if the interpreter is 64-bit capable.

`@``sdl2.ext.compat.``deprecated`

  A simple decorator to mark functions and methods as deprecated. This will print a deprecation message each time the function or method is invoked.

`sdl2.ext.compat.``deprecation`(message : string) → None

  Prints a deprecation message using the `warnings.warn()` function.

exception `sdl2.ext.compat.``UnsupportedError`(obj : object[, msg=None])

  Indicates that a certain class, function or behaviour is not supported in the specific execution environment.

`@``sdl2.ext.compat.``experimental`

  A simple decorator to mark functions and methods as experimental. This will print a warning each time the function or method is invoked.

exception `sdl2.ext.compat.``ExperimentalWarning`(obj : object[, msg=None])

  Indicates that a certain class, function or behaviour is in an experimental state.

### Navigation

- index
- modules |
- next |
- previous |
- PySDL2 0.9.2 documentation »
- API reference »
- sdl2.ext - Python extensions for SDL2 »