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

Nick Coghlan ncoghlan at gmail.com
Sat Oct 25 17:25:05 CEST 2014


On 25 October 2014 12:20, Russell Keith-Magee <russell at keith-magee.com> wrote:
> I'd like to start supporting more recent versions of Python - most
> importantly, Python 3. While I could certainly continue maintaining patches
> externally (and I imagine I'll have to if I want to maintain Python 2.7
> support), I'd like to see that effort integrated into Python's repository.

Maintaining support for new versions of existing platforms is already
within scope for Python  2.7, so if you get this working for Python 3,
it *might* be possible to make the case for 2.x. However, it would
only be feasible to make that determination after we had a better idea
as to the magnitude of the changes involved, and the risks introduced
for other platforms.

> In particular, there are four areas where I can see changes required:
>  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?

Yes, platform specific features are actually quite common (search the
docs for "Availability:"). It's just the fact that folks writing
cross-platform code tend to avoid those modules/features, so they're
largely only known to folks writing lower level (or otherwise platform
specific) code.

> Any platforms where Python is *only* available as a
> library?

The CPython main.c is a fairly thin shim around Py_Main anyway, so I
don't see it as a big deal whether the standard CLI is included as
part of the mobile builds.

> So - am I completely wasting my time? Are patches for mobile platforms
> likely to be accepted into Python's repository?

I think both iOS and Android are well and truly established enough now
as platforms to be worth targeting directly. For the CI problem, it
may be worth approaching Xamarin, as setting up the infrastructure for
doing that ourselves looks like a formidable engineering challenge we
don't currently have the relevant skillsets to provide.

Regards,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list