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
7506298d
Kaydet (Commit)
7506298d
authored
Şub 16, 1998
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Mark up filename extensions consistently.
Logical markup.
üst
3b26eedd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
42 deletions
+42
-42
libmarshal.tex
Doc/lib/libmarshal.tex
+21
-21
libmarshal.tex
Doc/libmarshal.tex
+21
-21
No files found.
Doc/lib/libmarshal.tex
Dosyayı görüntüle @
7506298d
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
This is not a general ``persistency'' module. For general persistency
This is not a general ``persistency'' module. For general persistency
and transfer of Python objects through RPC calls, see the modules
and transfer of Python objects through RPC calls, see the modules
\
code
{
pickle
}
and
\code
{
shelve
}
. The
\cod
e
{
marshal
}
module exists
\
module
{
pickle
}
and
\module
{
shelve
}
. The
\modul
e
{
marshal
}
module exists
mainly to support reading and writing the ``pseudo-compiled'' code for
mainly to support reading and writing the ``pseudo-compiled'' code for
Python modules of
\
samp
{
.pyc
}
files.
Python modules of
\
file
{
.pyc
}
files.
\refstmodindex
{
pickle
}
\refstmodindex
{
pickle
}
\refstmodindex
{
shelve
}
\refstmodindex
{
shelve
}
\obindex
{
code
}
\obindex
{
code
}
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
32 bits (such as the DEC Alpha), it
32 bits (such as the DEC Alpha), it
is possible to create plain Python integers that are longer than 32
is possible to create plain Python integers that are longer than 32
bits. Since the current
\
cod
e
{
marshal
}
module uses 32 bits to
bits. Since the current
\
modul
e
{
marshal
}
module uses 32 bits to
transfer plain Python integers, such values are silently truncated.
transfer plain Python integers, such values are silently truncated.
This particularly affects the use of very long integer literals in
This particularly affects the use of very long integer literals in
Python modules --- these will be accepted by the parser on such
Python modules --- these will be accepted by the parser on such
machines, but will be silently be truncated when the module is read
machines, but will be silently be truncated when the module is read
from the
\
cod
e
{
.pyc
}
instead.
%
from the
\
fil
e
{
.pyc
}
instead.
%
\footnote
{
A solution would be to refuse such literals in the parser,
\footnote
{
A solution would be to refuse such literals in the parser,
since they are inherently non-portable. Another solution would be to
since they are inherently non-portable. Another solution would be to
let the
\
code
{
marshal
}
module raise an exception when an integer value
let the
\
module
{
marshal
}
module raise an exception when an integer
would be truncated. At least one of these solutions will be
value
would be truncated. At least one of these solutions will be
implemented in a future version.
}
implemented in a future version.
}
There are functions that read/write files as well as functions
There are functions that read/write files as well as functions
...
@@ -59,34 +59,34 @@ The module defines these functions:
...
@@ -59,34 +59,34 @@ The module defines these functions:
\begin{funcdesc}
{
dump
}{
value
\,
file
}
\begin{funcdesc}
{
dump
}{
value
\,
file
}
Write the value on the open file. The value must be a supported
Write the value on the open file. The value must be a supported
type. The file must be an open file object such as
type. The file must be an open file object such as
\code
{
sys.stdout
}
or returned by
\
code
{
open()
}
or
\code
{
sys.stdout
}
or returned by
\
function
{
open()
}
or
\
code
{
posix.popen()
}
.
\
function
{
posix.popen()
}
.
If the value has (or contains an object that has) an unsupported type,
If the value has (or contains an object that has) an unsupported type,
a
\
code
{
ValueError
}
exception is raised -- but garbage data will also
a
\
exception
{
ValueError
}
exception is raised -- but garbage data
be written to the file. The object will not be properly read back b
y
will also be written to the file. The object will not be properl
y
\code
{
load()
}
.
read back by
\function
{
load()
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
load
}{
file
}
\begin{funcdesc}
{
load
}{
file
}
Read one value from the open file and return it. If no valid value
Read one value from the open file and return it. If no valid value
is read, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
is read, raise
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\
code
{
TypeError
}
. The file must be an open file object.
\
exception
{
TypeError
}
. The file must be an open file object.
Warning: If an object containing an unsupported type was marshalled
Warning: If an object containing an unsupported type was marshalled
with
\
code
{
dump()
}
,
\code
{
load()
}
will substitute
\code
{
None
}
for th
e
with
\
function
{
dump()
}
,
\function
{
load()
}
will substitut
e
unmarshallable type.
\code
{
None
}
for the
unmarshallable type.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
dumps
}{
value
}
\begin{funcdesc}
{
dumps
}{
value
}
Return the string that would be written to a file by
Return the string that would be written to a file by
\code
{
dump(
value, file)
}
. The value must be a supported type.
\code
{
dump(
\var
{
value
}
,
\var
{
file
}
)
}
. The value must be a supported
Raise a
\code
{
ValueError
}
exception if value has (or contains an
type. Raise a
\exception
{
ValueError
}
exception if value has (or
object that has) an unsupported type.
contains an
object that has) an unsupported type.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
loads
}{
string
}
\begin{funcdesc}
{
loads
}{
string
}
Convert the string to a value. If no valid value is found, raise
Convert the string to a value. If no valid value is found, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\code
{
TypeError
}
. Extra
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
characters in the string are ignored.
\exception
{
TypeError
}
. Extra
characters in the string are ignored.
\end{funcdesc}
\end{funcdesc}
Doc/libmarshal.tex
Dosyayı görüntüle @
7506298d
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
...
@@ -17,9 +17,9 @@ internal to external form (in an RPC buffer for instance) and
This is not a general ``persistency'' module. For general persistency
This is not a general ``persistency'' module. For general persistency
and transfer of Python objects through RPC calls, see the modules
and transfer of Python objects through RPC calls, see the modules
\
code
{
pickle
}
and
\code
{
shelve
}
. The
\cod
e
{
marshal
}
module exists
\
module
{
pickle
}
and
\module
{
shelve
}
. The
\modul
e
{
marshal
}
module exists
mainly to support reading and writing the ``pseudo-compiled'' code for
mainly to support reading and writing the ``pseudo-compiled'' code for
Python modules of
\
samp
{
.pyc
}
files.
Python modules of
\
file
{
.pyc
}
files.
\refstmodindex
{
pickle
}
\refstmodindex
{
pickle
}
\refstmodindex
{
shelve
}
\refstmodindex
{
shelve
}
\obindex
{
code
}
\obindex
{
code
}
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
...
@@ -37,16 +37,16 @@ supported; and recursive lists and dictionaries should not be written
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
\strong
{
Caveat:
}
On machines where C's
\code
{
long int
}
type has more than
32 bits (such as the DEC Alpha), it
32 bits (such as the DEC Alpha), it
is possible to create plain Python integers that are longer than 32
is possible to create plain Python integers that are longer than 32
bits. Since the current
\
cod
e
{
marshal
}
module uses 32 bits to
bits. Since the current
\
modul
e
{
marshal
}
module uses 32 bits to
transfer plain Python integers, such values are silently truncated.
transfer plain Python integers, such values are silently truncated.
This particularly affects the use of very long integer literals in
This particularly affects the use of very long integer literals in
Python modules --- these will be accepted by the parser on such
Python modules --- these will be accepted by the parser on such
machines, but will be silently be truncated when the module is read
machines, but will be silently be truncated when the module is read
from the
\
cod
e
{
.pyc
}
instead.
%
from the
\
fil
e
{
.pyc
}
instead.
%
\footnote
{
A solution would be to refuse such literals in the parser,
\footnote
{
A solution would be to refuse such literals in the parser,
since they are inherently non-portable. Another solution would be to
since they are inherently non-portable. Another solution would be to
let the
\
code
{
marshal
}
module raise an exception when an integer value
let the
\
module
{
marshal
}
module raise an exception when an integer
would be truncated. At least one of these solutions will be
value
would be truncated. At least one of these solutions will be
implemented in a future version.
}
implemented in a future version.
}
There are functions that read/write files as well as functions
There are functions that read/write files as well as functions
...
@@ -59,34 +59,34 @@ The module defines these functions:
...
@@ -59,34 +59,34 @@ The module defines these functions:
\begin{funcdesc}
{
dump
}{
value
\,
file
}
\begin{funcdesc}
{
dump
}{
value
\,
file
}
Write the value on the open file. The value must be a supported
Write the value on the open file. The value must be a supported
type. The file must be an open file object such as
type. The file must be an open file object such as
\code
{
sys.stdout
}
or returned by
\
code
{
open()
}
or
\code
{
sys.stdout
}
or returned by
\
function
{
open()
}
or
\
code
{
posix.popen()
}
.
\
function
{
posix.popen()
}
.
If the value has (or contains an object that has) an unsupported type,
If the value has (or contains an object that has) an unsupported type,
a
\
code
{
ValueError
}
exception is raised -- but garbage data will also
a
\
exception
{
ValueError
}
exception is raised -- but garbage data
be written to the file. The object will not be properly read back b
y
will also be written to the file. The object will not be properl
y
\code
{
load()
}
.
read back by
\function
{
load()
}
.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
load
}{
file
}
\begin{funcdesc}
{
load
}{
file
}
Read one value from the open file and return it. If no valid value
Read one value from the open file and return it. If no valid value
is read, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
is read, raise
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
\
code
{
TypeError
}
. The file must be an open file object.
\
exception
{
TypeError
}
. The file must be an open file object.
Warning: If an object containing an unsupported type was marshalled
Warning: If an object containing an unsupported type was marshalled
with
\
code
{
dump()
}
,
\code
{
load()
}
will substitute
\code
{
None
}
for th
e
with
\
function
{
dump()
}
,
\function
{
load()
}
will substitut
e
unmarshallable type.
\code
{
None
}
for the
unmarshallable type.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
dumps
}{
value
}
\begin{funcdesc}
{
dumps
}{
value
}
Return the string that would be written to a file by
Return the string that would be written to a file by
\code
{
dump(
value, file)
}
. The value must be a supported type.
\code
{
dump(
\var
{
value
}
,
\var
{
file
}
)
}
. The value must be a supported
Raise a
\code
{
ValueError
}
exception if value has (or contains an
type. Raise a
\exception
{
ValueError
}
exception if value has (or
object that has) an unsupported type.
contains an
object that has) an unsupported type.
\end{funcdesc}
\end{funcdesc}
\begin{funcdesc}
{
loads
}{
string
}
\begin{funcdesc}
{
loads
}{
string
}
Convert the string to a value. If no valid value is found, raise
Convert the string to a value. If no valid value is found, raise
\
code
{
EOFError
}
,
\code
{
ValueError
}
or
\code
{
TypeError
}
. Extra
\
exception
{
EOFError
}
,
\exception
{
ValueError
}
or
characters in the string are ignored.
\exception
{
TypeError
}
. Extra
characters in the string are ignored.
\end{funcdesc}
\end{funcdesc}
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