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
4008ef0f
Kaydet (Commit)
4008ef0f
authored
Eyl 27, 2008
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
clarify a few things
üst
e6896050
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
cporting.rst
Doc/howto/cporting.rst
+6
-7
No files found.
Doc/howto/cporting.rst
Dosyayı görüntüle @
4008ef0f
...
@@ -45,7 +45,7 @@ Python 3.0's :func:`str` (``PyString_*`` functions in C) type is equivalent to
...
@@ -45,7 +45,7 @@ Python 3.0's :func:`str` (``PyString_*`` functions in C) type is equivalent to
2.x's :func:`unicode` (``PyUnicode_*``). The old 8-bit string type has become
2.x's :func:`unicode` (``PyUnicode_*``). The old 8-bit string type has become
:func:`bytes`. Python 2.6 and later provide a compatibility header,
:func:`bytes`. Python 2.6 and later provide a compatibility header,
:file:`bytesobject.h`, mapping ``PyBytes`` names to ``PyString`` ones. For best
:file:`bytesobject.h`, mapping ``PyBytes`` names to ``PyString`` ones. For best
interpolation
with 3.0, :ctype:`PyUnicode` should be used for textual data and
compatibility
with 3.0, :ctype:`PyUnicode` should be used for textual data and
:ctype:`PyBytes` for binary data. It's also important to remember that
:ctype:`PyBytes` for binary data. It's also important to remember that
:ctype:`PyBytes` and :ctype:`PyUnicode` in 3.0 are not interchangeable like
:ctype:`PyBytes` and :ctype:`PyUnicode` in 3.0 are not interchangeable like
:ctype:`PyString` and :ctype:`PyString` are in 2.x. The following example shows
:ctype:`PyString` and :ctype:`PyString` are in 2.x. The following example shows
...
@@ -68,6 +68,7 @@ best practices with regards to :ctype:`PyUnicode`, :ctype:`PyString`, and
...
@@ -68,6 +68,7 @@ best practices with regards to :ctype:`PyUnicode`, :ctype:`PyString`, and
return result;
return result;
}
}
/* just a forward */
static char * do_encode(PyObject *);
static char * do_encode(PyObject *);
/* bytes example */
/* bytes example */
...
@@ -94,14 +95,12 @@ long/int Unification
...
@@ -94,14 +95,12 @@ long/int Unification
In Python 3.0, there is only one integer type. It is called :func:`int` on the
In Python 3.0, there is only one integer type. It is called :func:`int` on the
Python level, but actually corresponds to 2.x's :func:`long` type. In the
Python level, but actually corresponds to 2.x's :func:`long` type. In the
C-API, ``PyInt_*`` functions are replaced by their ``PyLong_*`` neighbors. The
C-API, ``PyInt_*`` functions are replaced by their ``PyLong_*`` neighbors. The
best course of action here is probably aliasing ``PyInt_*`` functions to
best course of action here is using the ``PyInt_*`` functions aliased to
``PyLong_*`` variants or using the abstract ``PyNumber_*`` APIs. ::
``PyLong_*`` found in :file:`intobject.h`. The the abstract ``PyNumber_*`` APIs
can also be used in some cases. ::
#include "Python.h"
#include "Python.h"
#include "intobject.h"
#if PY_MAJOR_VERSION >= 3
#define PyInt_FromLong PyLong_FromLong
#endif
static PyObject *
static PyObject *
add_ints(PyObject *self, PyObject *args) {
add_ints(PyObject *self, PyObject *args) {
...
...
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