Python 3
Summary
A packaged version of python 3.* will be provided within Fedora 13 as an optional component, parallel-installable with the Python 2 stack.
The critical system components that use Python 2 (yum, anaconda) shall continue to use Python 2.
Owner
- Name: Dave Malcolm
- email: <dmalcolm@redhat.com>
Current status
- Targeted release: Fedora 13
- Last updated: 2009-10-01
- Percentage of completion: 0%
Detailed Description
Python 3 is intended by upstream to be the future of Python, but we have many critical components that use Python 2. Python 2 and Python 3 are sufficiently different that we need both (try writing "print" in each). Python 2 will be around for a long time.
An interesting summary of Python 3 adoption can be seen here: http://renesd.blogspot.com/2009/09/py3kpython3-more-than-one-year-on-096.html
How to do this? I propose that Fedora shall have separate, parallel-installable Python 2 and Python 3 stacks. I believe we can get things to the point where on a Fedora box you'd be able to install both stacks, and have some processes running python 2 code, and some running python 3, simultaneously.
Where I would draw the line is on having both python 2 and python 3 running within the same _process_: the two libraries share most of their symbol names, but with differing implementations, and the result of trying to dynamically link the two into the same address space would be highly unstable.
As an example, you'd be able to install both mod_python and mod_python3 rpms, but you wouldn't be able to (sanely) configure httpd to have both running simultaneously (I guess we should add a run-time warning for this case)
Benefit to Fedora
Fedora has long been a great platform for doing Python 2 development, but we don't yet have Python 3. Having Python 3 available via rpms will extend our Python coverage.
Note also:
- Python 3.0 was released almost 10 months ago, on 2008-12-03, and the latest release of the 3.* branch is 3.1.1, released on 2009-08-17.
- Other distros have python 3, though not necessarily with anything "on top" resembling the full python 2 stack.
- We have a working, valuable python 2 stack, which is used by critical system components (yum and anaconda): we must not destabilize the python 2 stack.
- Python 3 is sufficiently different from python 2 that we need them to be independent software stacks.
Scope
A plan for packaging Python 3 and Python 3 modules was posted to fedora-devel-list here: https://www.redhat.com/archives/fedora-devel-list/2009-October/msg00054.html
A rough plan for Fedora 13 might be:
- get python3 packaged in a manner compatible with the above
- (persuade /usr/lib/rpm/brp-python-bytecompile to use the correct python when building rpms containing .py files)
- get rpm bindings working with python3
- get some useful components working e.g. a web stack: Django, TurboGears etc (though e.g. Django's py3k support is a long way off IIRC); ideas?
- solidify packaging guidelines for python 2 vs python 3 once we've got some experience with the above and hopefully proven the techniques
- look at porting major components over to python3 (but probably don't actually do this for F13; leave python 2 as the critical component, I suspect): yum (rpm), anaconda
At a minimum, we'd want python 3 to be available as an rpm via yum.
How To Test
User Experience
Dependencies
Contingency Plan
This will be all-new RPMs within Fedora. If there's a problem, we can simply not include them.