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
9fa76f10
Kaydet (Commit)
9fa76f10
authored
Kas 10, 1999
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use \citetitle in several places, and \programopt where appropriate.
üst
698d5206
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
20 deletions
+23
-20
ext.tex
Doc/ext/ext.tex
+23
-20
No files found.
Doc/ext/ext.tex
Dosyayı görüntüle @
9fa76f10
...
...
@@ -44,15 +44,16 @@ dynamically (at run time) into the interpreter, if the underlying
operating system supports this feature.
This document assumes basic knowledge about Python. For an informal
introduction to the language, see the Python Tutorial. The
\emph
{
Python
Reference Manual
}
gives a more formal definition of the language. The
\emph
{
Python Library Reference
}
documents the existing object types,
functions and modules (both built-in and written in Python) that give
the language its wide application range.
introduction to the language, see the
\citetitle
[../tut/tut.html]
{
Python Tutorial
}
. The
\citetitle
[../ref/ref.html]
{
Python Reference Manual
}
gives a more
formal definition of the language. The
\citetitle
[../lib/lib.html]
{
Python Library Reference
}
documents the
existing object types, functions and modules (both built-in and
written in Python) that give the language its wide application range.
For a detailed description of the whole Python/C API, see the separate
\emph
{
Python/C API Reference Manual
}
.
\citetitle
[../api/api.html]
{
Python/C API Reference Manual
}
.
\end{abstract}
...
...
@@ -179,9 +180,10 @@ argument to \keyword{raise}). A third variable contains the stack
traceback in case the error originated in Python code. These three
variables are the C equivalents of the Python variables
\code
{
sys.exc
_
type
}
,
\code
{
sys.exc
_
value
}
and
\code
{
sys.exc
_
traceback
}
(see
the section on module
\module
{
sys
}
in the
\emph
{
Python Library
Reference
}
). It is important to know about them to understand how
errors are passed around.
the section on module
\module
{
sys
}
in the
\citetitle
[../lib/lib.html]
{
Python Library Reference
}
). It is
important to know about them to understand how errors are passed
around.
The Python API defines a number of functions to set various types of
exceptions.
...
...
@@ -286,10 +288,11 @@ initspam()
Note that the Python name for the exception object is
\exception
{
spam.error
}
. The
\cfunction
{
PyErr
_
NewException()
}
function
may create either a string or class, depending on whether the
\samp
{
-X
}
flag was passed to the interpreter. If
\samp
{
-X
}
was used,
\cdata
{
SpamError
}
will be a string object, otherwise it will be a
class object with the base class being
\exception
{
Exception
}
,
described in the
\emph
{
Python Library Reference
}
under ``Built-in
\programopt
{
-X
}
flag was passed to the interpreter. If
\programopt
{
-X
}
was used,
\cdata
{
SpamError
}
will be a string object,
otherwise it will be a class object with the base class being
\exception
{
Exception
}
, described in the
\citetitle
[../lib/lib.html]
{
Python Library Reference
}
under ``Built-in
Exceptions.''
...
...
@@ -462,8 +465,8 @@ Fortunately, the Python interpreter is easily called recursively, and
there is a standard interface to call a Python function. (I won't
dwell on how to call the Python parser with a particular string as
input --- if you're interested, have a look at the implementation of
the
\
samp
{
-c
}
command line option in
\file
{
Python/pythonmain.c
}
from
the Python source code.)
the
\
programopt
{
-c
}
command line option in
\file
{
Python/pythonmain.c
}
from
the Python source code.)
Calling a Python function is easy. First, the Python program must
somehow pass you the Python function object. You should provide a
...
...
@@ -1565,10 +1568,10 @@ exported, so it has to be learned only once.
Finally it should be mentioned that CObjects offer additional
functionality, which is especially useful for memory allocation and
deallocation of the pointer stored in a CObject. The details
are described in the
\
emph
{
Python/C API Reference Manual
}
in the
section ``CObjects'' and in the implementation of CObjects (files
\file
{
Include/cobject.h
}
and
\file
{
Objects/cobject.c
}
in the
Python source code distribution).
are described in the
\
citetitle
[../api/api.html]
{
Python/C API
Reference Manual
}
in the section ``CObjects'' and in the
implementation of CObjects (files
\file
{
Include/cobject.h
}
and
\file
{
Objects/cobject.c
}
in the
Python source code distribution).
\chapter
{
Building C and
\Cpp
{}
Extensions on
\UNIX
{}
...
...
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