Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
56076dab
Kaydet (Commit)
56076dab
authored
Ara 02, 2008
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Finished the "porting to 3.0" section. Had to add a label to
howto/cporting.rst.
üst
715287f1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
cporting.rst
Doc/howto/cporting.rst
+2
-0
3.0.rst
Doc/whatsnew/3.0.rst
+29
-7
No files found.
Doc/howto/cporting.rst
Dosyayı görüntüle @
56076dab
.. highlightlang:: c
.. _cporting-howto:
********************************
Porting Extension Modules to 3.0
********************************
...
...
Doc/whatsnew/3.0.rst
Dosyayı görüntüle @
56076dab
...
...
@@ -426,6 +426,9 @@ consulted for longer descriptions.
Library Changes
===============
Due to time constraints, this document does not exhaustively cover
the very extensive changes to the library.
XXX Brief overview of what's changed in the library.
* :pep:`3108`: stdlib reorganization.
...
...
@@ -778,16 +781,35 @@ XXX Some of the more notable changes are:
Porting To Python 3.0
=====================
This section lists previously described changes that may require
changes to your code:
For porting existing Python 2.5 or 2.6 source code to Python 3.0, the
best strategy is the following:
0. (Prerequisite:) Start with excellent test coverage.
1. Port to Python 2.6. This should be no more work than the average
port from Python 2.x to Python 2.(x+1). Make sure all your tests
pass.
* Everything is all in the details!
2. (Still using 2.6:) Turn on the :option:`-3` command line switch.
This enables warnings about features that will be removed (or
change) in 3.0. Run your test suite again, and fix code that you
get warnings about until there are no warnings left, and all your
tests still pass.
* Developers can include :file:`intobject.h` after :file:`Python.h` for
some ``PyInt_`` aliases.
3. Run the ``2to3`` source-to-source translator over your source code
tree. (See :ref:`2to3-reference` for more on this tool.) Run the
result of the translation under Python 3.0. Manually fix up any
remaining issues, fixing problems until all tests pass again.
* XXX Mention 2to3.
It is not recommended to try to write source code that runs unchanged
under both Python 2.6 and 3.0; you'd have to use a very contorted
coding style, e.g. avoiding :keyword:`print` statements, metaclasses,
and much more. If you are maintaining a library that needs to support
both Python 2.6 and Python 3.0, the best approach is to modify step 3
above by editing the 2.6 version of the source code and running the
``2to3`` translator again, rather than editing the 3.0 version of the
source code.
* XXX Reference external doc about porting extensions?
For porting C extensions to Python 3.0, please see :ref:`cporting-howto`.
.. ======================================================================
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment