[Python-ideas] Adding iOS/Android support to Python

Masklinn masklinn at masklinn.net
Sat Oct 25 10:15:13 CEST 2014


On 2014-10-25, at 04:20 , Russell Keith-Magee <russell at keith-magee.com> wrote:
>  3) Disabling certain modules on mobile platforms. Supporting modules like linuxaudiodev, ossaudiodev, readline, curses, idle and tkinter on mobile platforms doesn't make much sense; modules likes bsddb and bz2 are difficult to support due to library dependencies; and the need for modules like multiprocessing is arguable (and difficult to support on mobile). Even providing a Python executable/shell is arguable for these platforms.
> 
> However, I would anticipate that 3 might raise some concerns, as the general Python "batteries included" philosophy would be modified to "unless you're on one of these platforms". Any guidance on whether this approach would be palatable? Is there any precedent for "module not supported on platform X" that I'm not aware of?

* IIRC, Python will not setup e.g. bz2 if there's no libbz2 on the
  system, likewise ssl and libssl, so the underlying library is not
  available on a platform it wouldn't be entirely surprising for it to be
  missing in the corresponding Python
* there are a number of modules which are only available on a 
  restricted number of platforms, though for the most part they're
  either windows-specific[0] or unix-specific[1]. There are also
  limitations within modules e.g. os.path.relpath is documented as
  only available on Unix and Windows, samepath and sameopenfile
  used to be Unix-only and are now Unix+Windows
* some modules also have very different contents or behaviors
  based on the platform e.g. ssl, signal or mmap

So there seems to be a precedent for stdlib modules entirely missing on
some platforms, or having restricted or platform-specific content.

[0] https://docs.python.org/3/library/windows.html
[1] https://docs.python.org/3/library/unix.html


More information about the Python-ideas mailing list