[lsb-discuss] Python 3

Jeff Licquia licquia at linuxfoundation.org
Tue Apr 17 23:12:00 UTC 2012

On 04/17/2012 06:40 PM, Dan Harrison wrote:
> First, a silly question: would this proposal include the interpreter, or
> would it also include the innards python library? You mentioned symbols
> in modules, but what about the Python core itself? If I wanted to write
> my own Python module in C, and compile it to an LSB Python target, what
> will the LSB say about the ABI I can expect? Anything?

Historically, none of the scripting languages have been willing to nail
down a C API enough for our purposes.  I'm expecting this to not have
changed recently.

> Second, regarding naming, this is something I have to fight with every
> day. On Arch Linux (completely off the LSB radar), they have decided
> "python" refers to 3, even though a ton of the Python packages (I would
> say probably a slim majority) still use 2. And it drives me up the wall.
> I suspect it will the next LSB users also, if their distros are a little
> bit lazy. So I would say that, for the sake of backward compatibility of
> the current spec, "python" means exactly what it used to mean, and is
> discouraged (perhaps even deprecated). Everyone could "python2" and
> "python3" explicitly from now on, if the LSB requires both, and that is
> that.

Completely off-the-cuff, without serious consideration: I'm expecting
that we will end up adding "python2" as part of the Python 2 spec,
requiring "python3" for the Python 3 spec, and deprecating "python".
That would leave us free to drop "python" completely at the right time.
 So an LSB-compliant Python script would have to choose.

> Third, I would add that there is an easy way to check to see if you are
> running Python 2 or 3: in a try-catch block, see if you are able to use
> the __future__ mechanism described here:
> http://www.python.org/dev/peps/pep-0236

Thanks!  That might become useful at some point.  We could, for example,
require that scripts that use "python" as their interpreter make use of
something like that.
Jeff Licquia
The Linux Foundation
+1 (317) 915-7441
licquia at linuxfoundation.org

Linux Foundation Events Schedule:  events.linuxfoundation.org
Linux Foundation Training Schedule: training.linuxfoundation.org

More information about the lsb-discuss mailing list