home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 42 75 69 6c 74 2d 69 |\section|{Built-i|
|00000010| 6e 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |n Module| \sectco|
|00000020| 64 65 7b 6d 61 72 73 68 | 61 6c 7d 7d 0a 0a 5c 62 |de{marsh|al}}..\b|
|00000030| 69 6d 6f 64 69 6e 64 65 | 78 7b 6d 61 72 73 68 61 |imodinde|x{marsha|
|00000040| 6c 7d 0a 54 68 69 73 20 | 6d 6f 64 75 6c 65 20 63 |l}.This |module c|
|00000050| 6f 6e 74 61 69 6e 73 20 | 66 75 6e 63 74 69 6f 6e |ontains |function|
|00000060| 73 20 74 68 61 74 20 63 | 61 6e 20 72 65 61 64 20 |s that c|an read |
|00000070| 61 6e 64 20 77 72 69 74 | 65 20 50 79 74 68 6f 6e |and writ|e Python|
|00000080| 0a 76 61 6c 75 65 73 20 | 69 6e 20 61 20 62 69 6e |.values |in a bin|
|00000090| 61 72 79 20 66 6f 72 6d | 61 74 2e 20 20 54 68 65 |ary form|at. The|
|000000a0| 20 66 6f 72 6d 61 74 20 | 69 73 20 73 70 65 63 69 | format |is speci|
|000000b0| 66 69 63 20 74 6f 20 50 | 79 74 68 6f 6e 2c 20 62 |fic to P|ython, b|
|000000c0| 75 74 0a 69 6e 64 65 70 | 65 6e 64 65 6e 74 20 6f |ut.indep|endent o|
|000000d0| 66 20 6d 61 63 68 69 6e | 65 20 61 72 63 68 69 74 |f machin|e archit|
|000000e0| 65 63 74 75 72 65 20 69 | 73 73 75 65 73 20 28 65 |ecture i|ssues (e|
|000000f0| 2e 67 2e 2c 20 79 6f 75 | 20 63 61 6e 20 77 72 69 |.g., you| can wri|
|00000100| 74 65 20 61 0a 50 79 74 | 68 6f 6e 20 76 61 6c 75 |te a.Pyt|hon valu|
|00000110| 65 20 74 6f 20 61 20 66 | 69 6c 65 20 6f 6e 20 61 |e to a f|ile on a|
|00000120| 20 50 43 2c 20 74 72 61 | 6e 73 70 6f 72 74 20 74 | PC, tra|nsport t|
|00000130| 68 65 20 66 69 6c 65 20 | 74 6f 20 61 20 53 75 6e |he file |to a Sun|
|00000140| 2c 20 61 6e 64 20 72 65 | 61 64 0a 69 74 20 62 61 |, and re|ad.it ba|
|00000150| 63 6b 20 74 68 65 72 65 | 29 2e 20 20 44 65 74 61 |ck there|). Deta|
|00000160| 69 6c 73 20 6f 66 20 74 | 68 65 20 66 6f 72 6d 61 |ils of t|he forma|
|00000170| 74 20 61 72 65 20 75 6e | 64 6f 63 75 6d 65 6e 74 |t are un|document|
|00000180| 65 64 20 6f 6e 20 70 75 | 72 70 6f 73 65 3b 0a 69 |ed on pu|rpose;.i|
|00000190| 74 20 6d 61 79 20 63 68 | 61 6e 67 65 20 62 65 74 |t may ch|ange bet|
|000001a0| 77 65 65 6e 20 50 79 74 | 68 6f 6e 20 76 65 72 73 |ween Pyt|hon vers|
|000001b0| 69 6f 6e 73 20 28 61 6c | 74 68 6f 75 67 68 20 69 |ions (al|though i|
|000001c0| 74 20 72 61 72 65 6c 79 | 20 64 6f 65 73 29 2e 25 |t rarely| does).%|
|000001d0| 0a 5c 66 6f 6f 74 6e 6f | 74 65 7b 54 68 65 20 6e |.\footno|te{The n|
|000001e0| 61 6d 65 20 6f 66 20 74 | 68 69 73 20 6d 6f 64 75 |ame of t|his modu|
|000001f0| 6c 65 20 73 74 65 6d 73 | 20 66 72 6f 6d 20 61 20 |le stems| from a |
|00000200| 62 69 74 20 6f 66 20 74 | 65 72 6d 69 6e 6f 6c 6f |bit of t|erminolo|
|00000210| 67 79 20 75 73 65 64 0a | 62 79 20 74 68 65 20 64 |gy used.|by the d|
|00000220| 65 73 69 67 6e 65 72 73 | 20 6f 66 20 4d 6f 64 75 |esigners| of Modu|
|00000230| 6c 61 2d 33 20 28 61 6d | 6f 6e 67 73 74 20 6f 74 |la-3 (am|ongst ot|
|00000240| 68 65 72 73 29 2c 20 77 | 68 6f 20 75 73 65 20 74 |hers), w|ho use t|
|00000250| 68 65 20 74 65 72 6d 0a | 60 60 6d 61 72 73 68 61 |he term.|``marsha|
|00000260| 6c 6c 69 6e 67 27 27 20 | 66 6f 72 20 73 68 69 70 |lling'' |for ship|
|00000270| 70 69 6e 67 20 6f 66 20 | 64 61 74 61 20 61 72 6f |ping of |data aro|
|00000280| 75 6e 64 20 69 6e 20 61 | 20 73 65 6c 66 2d 63 6f |und in a| self-co|
|00000290| 6e 74 61 69 6e 65 64 20 | 66 6f 72 6d 2e 0a 53 74 |ntained |form..St|
|000002a0| 72 69 63 74 6c 79 20 73 | 70 65 61 6b 69 6e 67 2c |rictly s|peaking,|
|000002b0| 20 60 60 74 6f 20 6d 61 | 72 73 68 61 6c 27 27 20 | ``to ma|rshal'' |
|000002c0| 6d 65 61 6e 73 20 74 6f | 20 63 6f 6e 76 65 72 74 |means to| convert|
|000002d0| 20 73 6f 6d 65 20 64 61 | 74 61 20 66 72 6f 6d 0a | some da|ta from.|
|000002e0| 69 6e 74 65 72 6e 61 6c | 20 74 6f 20 65 78 74 65 |internal| to exte|
|000002f0| 72 6e 61 6c 20 66 6f 72 | 6d 20 28 69 6e 20 61 6e |rnal for|m (in an|
|00000300| 20 52 50 43 20 62 75 66 | 66 65 72 20 66 6f 72 20 | RPC buf|fer for |
|00000310| 69 6e 73 74 61 6e 63 65 | 29 20 61 6e 64 0a 60 60 |instance|) and.``|
|00000320| 75 6e 6d 61 72 73 68 61 | 6c 6c 69 6e 67 27 27 20 |unmarsha|lling'' |
|00000330| 66 6f 72 20 74 68 65 20 | 72 65 76 65 72 73 65 20 |for the |reverse |
|00000340| 70 72 6f 63 65 73 73 2e | 7d 0a 0a 54 68 69 73 20 |process.|}..This |
|00000350| 69 73 20 6e 6f 74 20 61 | 20 67 65 6e 65 72 61 6c |is not a| general|
|00000360| 20 60 60 70 65 72 73 69 | 73 74 65 6e 63 79 27 27 | ``persi|stency''|
|00000370| 20 6d 6f 64 75 6c 65 2e | 20 20 46 6f 72 20 67 65 | module.| For ge|
|00000380| 6e 65 72 61 6c 20 70 65 | 72 73 69 73 74 65 6e 63 |neral pe|rsistenc|
|00000390| 79 0a 61 6e 64 20 74 72 | 61 6e 73 66 65 72 20 6f |y.and tr|ansfer o|
|000003a0| 66 20 50 79 74 68 6f 6e | 20 6f 62 6a 65 63 74 73 |f Python| objects|
|000003b0| 20 74 68 72 6f 75 67 68 | 20 52 50 43 20 63 61 6c | through| RPC cal|
|000003c0| 6c 73 2c 20 73 65 65 20 | 74 68 65 20 6d 6f 64 75 |ls, see |the modu|
|000003d0| 6c 65 73 0a 5c 63 6f 64 | 65 7b 70 69 63 6b 6c 65 |les.\cod|e{pickle|
|000003e0| 7d 20 61 6e 64 20 5c 63 | 6f 64 65 7b 73 68 65 6c |} and \c|ode{shel|
|000003f0| 76 65 7d 2e 20 20 54 68 | 65 20 5c 63 6f 64 65 7b |ve}. Th|e \code{|
|00000400| 6d 61 72 73 68 61 6c 7d | 20 6d 6f 64 75 6c 65 20 |marshal}| module |
|00000410| 65 78 69 73 74 73 0a 6d | 61 69 6e 6c 79 20 74 6f |exists.m|ainly to|
|00000420| 20 73 75 70 70 6f 72 74 | 20 72 65 61 64 69 6e 67 | support| reading|
|00000430| 20 61 6e 64 20 77 72 69 | 74 69 6e 67 20 74 68 65 | and wri|ting the|
|00000440| 20 60 60 70 73 65 75 64 | 6f 2d 63 6f 6d 70 69 6c | ``pseud|o-compil|
|00000450| 65 64 27 27 20 63 6f 64 | 65 20 66 6f 72 0a 50 79 |ed'' cod|e for.Py|
|00000460| 74 68 6f 6e 20 6d 6f 64 | 75 6c 65 73 20 6f 66 20 |thon mod|ules of |
|00000470| 5c 73 61 6d 70 7b 2e 70 | 79 63 7d 20 66 69 6c 65 |\samp{.p|yc} file|
|00000480| 73 2e 0a 5c 73 74 6d 6f | 64 69 6e 64 65 78 7b 70 |s..\stmo|dindex{p|
|00000490| 69 63 6b 6c 65 7d 0a 5c | 73 74 6d 6f 64 69 6e 64 |ickle}.\|stmodind|
|000004a0| 65 78 7b 73 68 65 6c 76 | 65 7d 0a 5c 6f 62 69 6e |ex{shelv|e}.\obin|
|000004b0| 64 65 78 7b 63 6f 64 65 | 7d 0a 0a 4e 6f 74 20 61 |dex{code|}..Not a|
|000004c0| 6c 6c 20 50 79 74 68 6f | 6e 20 6f 62 6a 65 63 74 |ll Pytho|n object|
|000004d0| 20 74 79 70 65 73 20 61 | 72 65 20 73 75 70 70 6f | types a|re suppo|
|000004e0| 72 74 65 64 3b 20 69 6e | 20 67 65 6e 65 72 61 6c |rted; in| general|
|000004f0| 2c 20 6f 6e 6c 79 20 6f | 62 6a 65 63 74 73 0a 77 |, only o|bjects.w|
|00000500| 68 6f 73 65 20 76 61 6c | 75 65 20 69 73 20 69 6e |hose val|ue is in|
|00000510| 64 65 70 65 6e 64 65 6e | 74 20 66 72 6f 6d 20 61 |dependen|t from a|
|00000520| 20 70 61 72 74 69 63 75 | 6c 61 72 20 69 6e 76 6f | particu|lar invo|
|00000530| 63 61 74 69 6f 6e 20 6f | 66 20 50 79 74 68 6f 6e |cation o|f Python|
|00000540| 20 63 61 6e 0a 62 65 20 | 77 72 69 74 74 65 6e 20 | can.be |written |
|00000550| 61 6e 64 20 72 65 61 64 | 20 62 79 20 74 68 69 73 |and read| by this|
|00000560| 20 6d 6f 64 75 6c 65 2e | 20 20 54 68 65 20 66 6f | module.| The fo|
|00000570| 6c 6c 6f 77 69 6e 67 20 | 74 79 70 65 73 20 61 72 |llowing |types ar|
|00000580| 65 20 73 75 70 70 6f 72 | 74 65 64 3a 0a 5c 63 6f |e suppor|ted:.\co|
|00000590| 64 65 7b 4e 6f 6e 65 7d | 2c 20 69 6e 74 65 67 65 |de{None}|, intege|
|000005a0| 72 73 2c 20 6c 6f 6e 67 | 20 69 6e 74 65 67 65 72 |rs, long| integer|
|000005b0| 73 2c 20 66 6c 6f 61 74 | 69 6e 67 20 70 6f 69 6e |s, float|ing poin|
|000005c0| 74 20 6e 75 6d 62 65 72 | 73 2c 0a 73 74 72 69 6e |t number|s,.strin|
|000005d0| 67 73 2c 20 74 75 70 6c | 65 73 2c 20 6c 69 73 74 |gs, tupl|es, list|
|000005e0| 73 2c 20 64 69 63 74 69 | 6f 6e 61 72 69 65 73 2c |s, dicti|onaries,|
|000005f0| 20 61 6e 64 20 63 6f 64 | 65 20 6f 62 6a 65 63 74 | and cod|e object|
|00000600| 73 2c 20 77 68 65 72 65 | 20 69 74 0a 73 68 6f 75 |s, where| it.shou|
|00000610| 6c 64 20 62 65 20 75 6e | 64 65 72 73 74 6f 6f 64 |ld be un|derstood|
|00000620| 20 74 68 61 74 20 74 75 | 70 6c 65 73 2c 20 6c 69 | that tu|ples, li|
|00000630| 73 74 73 20 61 6e 64 20 | 64 69 63 74 69 6f 6e 61 |sts and |dictiona|
|00000640| 72 69 65 73 20 61 72 65 | 20 6f 6e 6c 79 0a 73 75 |ries are| only.su|
|00000650| 70 70 6f 72 74 65 64 20 | 61 73 20 6c 6f 6e 67 20 |pported |as long |
|00000660| 61 73 20 74 68 65 20 76 | 61 6c 75 65 73 20 63 6f |as the v|alues co|
|00000670| 6e 74 61 69 6e 65 64 20 | 74 68 65 72 65 69 6e 20 |ntained |therein |
|00000680| 61 72 65 20 74 68 65 6d | 73 65 6c 76 65 73 0a 73 |are them|selves.s|
|00000690| 75 70 70 6f 72 74 65 64 | 3b 20 61 6e 64 20 72 65 |upported|; and re|
|000006a0| 63 75 72 73 69 76 65 20 | 6c 69 73 74 73 20 61 6e |cursive |lists an|
|000006b0| 64 20 64 69 63 74 69 6f | 6e 61 72 69 65 73 20 73 |d dictio|naries s|
|000006c0| 68 6f 75 6c 64 20 6e 6f | 74 20 62 65 20 77 72 69 |hould no|t be wri|
|000006d0| 74 74 65 6e 0a 28 74 68 | 65 79 20 77 69 6c 6c 20 |tten.(th|ey will |
|000006e0| 63 61 75 73 65 20 69 6e | 66 69 6e 69 74 65 20 6c |cause in|finite l|
|000006f0| 6f 6f 70 73 29 2e 0a 0a | 7b 5c 62 66 20 43 61 76 |oops)...|{\bf Cav|
|00000700| 65 61 74 3a 7d 20 4f 6e | 20 6d 61 63 68 69 6e 65 |eat:} On| machine|
|00000710| 73 20 77 68 65 72 65 20 | 43 27 73 20 5c 63 6f 64 |s where |C's \cod|
|00000720| 65 7b 6c 6f 6e 67 20 69 | 6e 74 7d 20 74 79 70 65 |e{long i|nt} type|
|00000730| 20 68 61 73 20 6d 6f 72 | 65 20 74 68 61 6e 0a 33 | has mor|e than.3|
|00000740| 32 20 62 69 74 73 20 28 | 73 75 63 68 20 61 73 20 |2 bits (|such as |
|00000750| 74 68 65 20 44 45 43 20 | 41 6c 70 68 61 29 2c 20 |the DEC |Alpha), |
|00000760| 69 74 0a 69 73 20 70 6f | 73 73 69 62 6c 65 20 74 |it.is po|ssible t|
|00000770| 6f 20 63 72 65 61 74 65 | 20 70 6c 61 69 6e 20 50 |o create| plain P|
|00000780| 79 74 68 6f 6e 20 69 6e | 74 65 67 65 72 73 20 74 |ython in|tegers t|
|00000790| 68 61 74 20 61 72 65 20 | 6c 6f 6e 67 65 72 20 74 |hat are |longer t|
|000007a0| 68 61 6e 20 33 32 0a 62 | 69 74 73 2e 20 20 53 69 |han 32.b|its. Si|
|000007b0| 6e 63 65 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |nce the |current |
|000007c0| 5c 63 6f 64 65 7b 6d 61 | 72 73 68 61 6c 7d 20 6d |\code{ma|rshal} m|
|000007d0| 6f 64 75 6c 65 20 75 73 | 65 73 20 33 32 20 62 69 |odule us|es 32 bi|
|000007e0| 74 73 20 74 6f 0a 74 72 | 61 6e 73 66 65 72 20 70 |ts to.tr|ansfer p|
|000007f0| 6c 61 69 6e 20 50 79 74 | 68 6f 6e 20 69 6e 74 65 |lain Pyt|hon inte|
|00000800| 67 65 72 73 2c 20 73 75 | 63 68 20 76 61 6c 75 65 |gers, su|ch value|
|00000810| 73 20 61 72 65 20 73 69 | 6c 65 6e 74 6c 79 20 74 |s are si|lently t|
|00000820| 72 75 6e 63 61 74 65 64 | 2e 0a 54 68 69 73 20 70 |runcated|..This p|
|00000830| 61 72 74 69 63 75 6c 61 | 72 6c 79 20 61 66 66 65 |articula|rly affe|
|00000840| 63 74 73 20 74 68 65 20 | 75 73 65 20 6f 66 20 76 |cts the |use of v|
|00000850| 65 72 79 20 6c 6f 6e 67 | 20 69 6e 74 65 67 65 72 |ery long| integer|
|00000860| 20 6c 69 74 65 72 61 6c | 73 20 69 6e 0a 50 79 74 | literal|s in.Pyt|
|00000870| 68 6f 6e 20 6d 6f 64 75 | 6c 65 73 20 2d 2d 2d 20 |hon modu|les --- |
|00000880| 74 68 65 73 65 20 77 69 | 6c 6c 20 62 65 20 61 63 |these wi|ll be ac|
|00000890| 63 65 70 74 65 64 20 62 | 79 20 74 68 65 20 70 61 |cepted b|y the pa|
|000008a0| 72 73 65 72 20 6f 6e 20 | 73 75 63 68 0a 6d 61 63 |rser on |such.mac|
|000008b0| 68 69 6e 65 73 2c 20 62 | 75 74 20 77 69 6c 6c 20 |hines, b|ut will |
|000008c0| 62 65 20 73 69 6c 65 6e | 74 6c 79 20 62 65 20 74 |be silen|tly be t|
|000008d0| 72 75 6e 63 61 74 65 64 | 20 77 68 65 6e 20 74 68 |runcated| when th|
|000008e0| 65 20 6d 6f 64 75 6c 65 | 20 69 73 20 72 65 61 64 |e module| is read|
|000008f0| 0a 66 72 6f 6d 20 74 68 | 65 20 5c 63 6f 64 65 7b |.from th|e \code{|
|00000900| 2e 70 79 63 7d 20 69 6e | 73 74 65 61 64 2e 25 0a |.pyc} in|stead.%.|
|00000910| 5c 66 6f 6f 74 6e 6f 74 | 65 7b 41 20 73 6f 6c 75 |\footnot|e{A solu|
|00000920| 74 69 6f 6e 20 77 6f 75 | 6c 64 20 62 65 20 74 6f |tion wou|ld be to|
|00000930| 20 72 65 66 75 73 65 20 | 73 75 63 68 20 6c 69 74 | refuse |such lit|
|00000940| 65 72 61 6c 73 20 69 6e | 20 74 68 65 20 70 61 72 |erals in| the par|
|00000950| 73 65 72 2c 0a 73 69 6e | 63 65 20 74 68 65 79 20 |ser,.sin|ce they |
|00000960| 61 72 65 20 69 6e 68 65 | 72 65 6e 74 6c 79 20 6e |are inhe|rently n|
|00000970| 6f 6e 2d 70 6f 72 74 61 | 62 6c 65 2e 20 20 41 6e |on-porta|ble. An|
|00000980| 6f 74 68 65 72 20 73 6f | 6c 75 74 69 6f 6e 20 77 |other so|lution w|
|00000990| 6f 75 6c 64 20 62 65 20 | 74 6f 0a 6c 65 74 20 74 |ould be |to.let t|
|000009a0| 68 65 20 5c 63 6f 64 65 | 7b 6d 61 72 73 68 61 6c |he \code|{marshal|
|000009b0| 7d 20 6d 6f 64 75 6c 65 | 20 72 61 69 73 65 20 61 |} module| raise a|
|000009c0| 6e 20 65 78 63 65 70 74 | 69 6f 6e 20 77 68 65 6e |n except|ion when|
|000009d0| 20 61 6e 20 69 6e 74 65 | 67 65 72 20 76 61 6c 75 | an inte|ger valu|
|000009e0| 65 0a 77 6f 75 6c 64 20 | 62 65 20 74 72 75 6e 63 |e.would |be trunc|
|000009f0| 61 74 65 64 2e 20 20 41 | 74 20 6c 65 61 73 74 20 |ated. A|t least |
|00000a00| 6f 6e 65 20 6f 66 20 74 | 68 65 73 65 20 73 6f 6c |one of t|hese sol|
|00000a10| 75 74 69 6f 6e 73 20 77 | 69 6c 6c 20 62 65 0a 69 |utions w|ill be.i|
|00000a20| 6d 70 6c 65 6d 65 6e 74 | 65 64 20 69 6e 20 61 20 |mplement|ed in a |
|00000a30| 66 75 74 75 72 65 20 76 | 65 72 73 69 6f 6e 2e 7d |future v|ersion.}|
|00000a40| 0a 0a 54 68 65 72 65 20 | 61 72 65 20 66 75 6e 63 |..There |are func|
|00000a50| 74 69 6f 6e 73 20 74 68 | 61 74 20 72 65 61 64 2f |tions th|at read/|
|00000a60| 77 72 69 74 65 20 66 69 | 6c 65 73 20 61 73 20 77 |write fi|les as w|
|00000a70| 65 6c 6c 20 61 73 20 66 | 75 6e 63 74 69 6f 6e 73 |ell as f|unctions|
|00000a80| 0a 6f 70 65 72 61 74 69 | 6e 67 20 6f 6e 20 73 74 |.operati|ng on st|
|00000a90| 72 69 6e 67 73 2e 0a 0a | 54 68 65 20 6d 6f 64 75 |rings...|The modu|
|00000aa0| 6c 65 20 64 65 66 69 6e | 65 73 20 74 68 65 73 65 |le defin|es these|
|00000ab0| 20 66 75 6e 63 74 69 6f | 6e 73 3a 0a 0a 5c 72 65 | functio|ns:..\re|
|00000ac0| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 69 6e 64 65 |newcomma|nd{\inde|
|00000ad0| 78 73 75 62 69 74 65 6d | 7d 7b 28 69 6e 20 6d 6f |xsubitem|}{(in mo|
|00000ae0| 64 75 6c 65 20 6d 61 72 | 73 68 61 6c 29 7d 0a 0a |dule mar|shal)}..|
|00000af0| 5c 62 65 67 69 6e 7b 66 | 75 6e 63 64 65 73 63 7d |\begin{f|uncdesc}|
|00000b00| 7b 64 75 6d 70 7d 7b 76 | 61 6c 75 65 5c 2c 20 66 |{dump}{v|alue\, f|
|00000b10| 69 6c 65 7d 0a 20 20 57 | 72 69 74 65 20 74 68 65 |ile}. W|rite the|
|00000b20| 20 76 61 6c 75 65 20 6f | 6e 20 74 68 65 20 6f 70 | value o|n the op|
|00000b30| 65 6e 20 66 69 6c 65 2e | 20 20 54 68 65 20 76 61 |en file.| The va|
|00000b40| 6c 75 65 20 6d 75 73 74 | 20 62 65 20 61 20 73 75 |lue must| be a su|
|00000b50| 70 70 6f 72 74 65 64 0a | 20 20 74 79 70 65 2e 20 |pported.| type. |
|00000b60| 20 54 68 65 20 66 69 6c | 65 20 6d 75 73 74 20 62 | The fil|e must b|
|00000b70| 65 20 61 6e 20 6f 70 65 | 6e 20 66 69 6c 65 20 6f |e an ope|n file o|
|00000b80| 62 6a 65 63 74 20 73 75 | 63 68 20 61 73 0a 20 20 |bject su|ch as. |
|00000b90| 5c 63 6f 64 65 7b 73 79 | 73 2e 73 74 64 6f 75 74 |\code{sy|s.stdout|
|00000ba0| 7d 20 6f 72 20 72 65 74 | 75 72 6e 65 64 20 62 79 |} or ret|urned by|
|00000bb0| 20 5c 63 6f 64 65 7b 6f | 70 65 6e 28 29 7d 20 6f | \code{o|pen()} o|
|00000bc0| 72 0a 20 20 5c 63 6f 64 | 65 7b 70 6f 73 69 78 2e |r. \cod|e{posix.|
|00000bd0| 70 6f 70 65 6e 28 29 7d | 2e 0a 20 20 0a 20 20 49 |popen()}|.. . I|
|00000be0| 66 20 74 68 65 20 76 61 | 6c 75 65 20 68 61 73 20 |f the va|lue has |
|00000bf0| 28 6f 72 20 63 6f 6e 74 | 61 69 6e 73 20 61 6e 20 |(or cont|ains an |
|00000c00| 6f 62 6a 65 63 74 20 74 | 68 61 74 20 68 61 73 29 |object t|hat has)|
|00000c10| 20 61 6e 20 75 6e 73 75 | 70 70 6f 72 74 65 64 20 | an unsu|pported |
|00000c20| 74 79 70 65 2c 0a 20 20 | 61 20 5c 63 6f 64 65 7b |type,. |a \code{|
|00000c30| 56 61 6c 75 65 45 72 72 | 6f 72 7d 20 65 78 63 65 |ValueErr|or} exce|
|00000c40| 70 74 69 6f 6e 20 69 73 | 20 72 61 69 73 65 64 20 |ption is| raised |
|00000c50| 2d 2d 20 62 75 74 20 67 | 61 72 62 61 67 65 20 64 |-- but g|arbage d|
|00000c60| 61 74 61 20 77 69 6c 6c | 20 61 6c 73 6f 0a 20 20 |ata will| also. |
|00000c70| 62 65 20 77 72 69 74 74 | 65 6e 20 74 6f 20 74 68 |be writt|en to th|
|00000c80| 65 20 66 69 6c 65 2e 20 | 20 54 68 65 20 6f 62 6a |e file. | The obj|
|00000c90| 65 63 74 20 77 69 6c 6c | 20 6e 6f 74 20 62 65 20 |ect will| not be |
|00000ca0| 70 72 6f 70 65 72 6c 79 | 20 72 65 61 64 20 62 61 |properly| read ba|
|00000cb0| 63 6b 20 62 79 0a 20 20 | 5c 63 6f 64 65 7b 6c 6f |ck by. |\code{lo|
|00000cc0| 61 64 28 29 7d 2e 0a 5c | 65 6e 64 7b 66 75 6e 63 |ad()}..\|end{func|
|00000cd0| 64 65 73 63 7d 0a 0a 5c | 62 65 67 69 6e 7b 66 75 |desc}..\|begin{fu|
|00000ce0| 6e 63 64 65 73 63 7d 7b | 6c 6f 61 64 7d 7b 66 69 |ncdesc}{|load}{fi|
|00000cf0| 6c 65 7d 0a 20 20 52 65 | 61 64 20 6f 6e 65 20 76 |le}. Re|ad one v|
|00000d00| 61 6c 75 65 20 66 72 6f | 6d 20 74 68 65 20 6f 70 |alue fro|m the op|
|00000d10| 65 6e 20 66 69 6c 65 20 | 61 6e 64 20 72 65 74 75 |en file |and retu|
|00000d20| 72 6e 20 69 74 2e 20 20 | 49 66 20 6e 6f 20 76 61 |rn it. |If no va|
|00000d30| 6c 69 64 20 76 61 6c 75 | 65 0a 20 20 69 73 20 72 |lid valu|e. is r|
|00000d40| 65 61 64 2c 20 72 61 69 | 73 65 20 5c 63 6f 64 65 |ead, rai|se \code|
|00000d50| 7b 45 4f 46 45 72 72 6f | 72 7d 2c 20 5c 63 6f 64 |{EOFErro|r}, \cod|
|00000d60| 65 7b 56 61 6c 75 65 45 | 72 72 6f 72 7d 20 6f 72 |e{ValueE|rror} or|
|00000d70| 0a 20 20 5c 63 6f 64 65 | 7b 54 79 70 65 45 72 72 |. \code|{TypeErr|
|00000d80| 6f 72 7d 2e 20 20 54 68 | 65 20 66 69 6c 65 20 6d |or}. Th|e file m|
|00000d90| 75 73 74 20 62 65 20 61 | 6e 20 6f 70 65 6e 20 66 |ust be a|n open f|
|00000da0| 69 6c 65 20 6f 62 6a 65 | 63 74 2e 0a 0a 20 20 57 |ile obje|ct... W|
|00000db0| 61 72 6e 69 6e 67 3a 20 | 49 66 20 61 6e 20 6f 62 |arning: |If an ob|
|00000dc0| 6a 65 63 74 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ject con|taining |
|00000dd0| 61 6e 20 75 6e 73 75 70 | 70 6f 72 74 65 64 20 74 |an unsup|ported t|
|00000de0| 79 70 65 20 77 61 73 20 | 6d 61 72 73 68 61 6c 6c |ype was |marshall|
|00000df0| 65 64 0a 20 20 77 69 74 | 68 20 5c 63 6f 64 65 7b |ed. wit|h \code{|
|00000e00| 64 75 6d 70 28 29 7d 2c | 20 5c 63 6f 64 65 7b 6c |dump()},| \code{l|
|00000e10| 6f 61 64 28 29 7d 20 77 | 69 6c 6c 20 73 75 62 73 |oad()} w|ill subs|
|00000e20| 74 69 74 75 74 65 20 5c | 63 6f 64 65 7b 4e 6f 6e |titute \|code{Non|
|00000e30| 65 7d 20 66 6f 72 20 74 | 68 65 0a 20 20 75 6e 6d |e} for t|he. unm|
|00000e40| 61 72 73 68 61 6c 6c 61 | 62 6c 65 20 74 79 70 65 |arshalla|ble type|
|00000e50| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|00000e60| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|00000e70| 63 7d 7b 64 75 6d 70 73 | 7d 7b 76 61 6c 75 65 7d |c}{dumps|}{value}|
|00000e80| 0a 20 20 52 65 74 75 72 | 6e 20 74 68 65 20 73 74 |. Retur|n the st|
|00000e90| 72 69 6e 67 20 74 68 61 | 74 20 77 6f 75 6c 64 20 |ring tha|t would |
|00000ea0| 62 65 20 77 72 69 74 74 | 65 6e 20 74 6f 20 61 20 |be writt|en to a |
|00000eb0| 66 69 6c 65 20 62 79 0a | 20 20 5c 63 6f 64 65 7b |file by.| \code{|
|00000ec0| 64 75 6d 70 28 76 61 6c | 75 65 2c 20 66 69 6c 65 |dump(val|ue, file|
|00000ed0| 29 7d 2e 20 20 54 68 65 | 20 76 61 6c 75 65 20 6d |)}. The| value m|
|00000ee0| 75 73 74 20 62 65 20 61 | 20 73 75 70 70 6f 72 74 |ust be a| support|
|00000ef0| 65 64 20 74 79 70 65 2e | 0a 20 20 52 61 69 73 65 |ed type.|. Raise|
|00000f00| 20 61 20 5c 63 6f 64 65 | 7b 56 61 6c 75 65 45 72 | a \code|{ValueEr|
|00000f10| 72 6f 72 7d 20 65 78 63 | 65 70 74 69 6f 6e 20 69 |ror} exc|eption i|
|00000f20| 66 20 76 61 6c 75 65 20 | 68 61 73 20 28 6f 72 20 |f value |has (or |
|00000f30| 63 6f 6e 74 61 69 6e 73 | 20 61 6e 0a 20 20 6f 62 |contains| an. ob|
|00000f40| 6a 65 63 74 20 74 68 61 | 74 20 68 61 73 29 20 61 |ject tha|t has) a|
|00000f50| 6e 20 75 6e 73 75 70 70 | 6f 72 74 65 64 20 74 79 |n unsupp|orted ty|
|00000f60| 70 65 2e 0a 5c 65 6e 64 | 7b 66 75 6e 63 64 65 73 |pe..\end|{funcdes|
|00000f70| 63 7d 0a 0a 5c 62 65 67 | 69 6e 7b 66 75 6e 63 64 |c}..\beg|in{funcd|
|00000f80| 65 73 63 7d 7b 6c 6f 61 | 64 73 7d 7b 73 74 72 69 |esc}{loa|ds}{stri|
|00000f90| 6e 67 7d 0a 20 20 43 6f | 6e 76 65 72 74 20 74 68 |ng}. Co|nvert th|
|00000fa0| 65 20 73 74 72 69 6e 67 | 20 74 6f 20 61 20 76 61 |e string| to a va|
|00000fb0| 6c 75 65 2e 20 20 49 66 | 20 6e 6f 20 76 61 6c 69 |lue. If| no vali|
|00000fc0| 64 20 76 61 6c 75 65 20 | 69 73 20 66 6f 75 6e 64 |d value |is found|
|00000fd0| 2c 20 72 61 69 73 65 0a | 20 20 5c 63 6f 64 65 7b |, raise.| \code{|
|00000fe0| 45 4f 46 45 72 72 6f 72 | 7d 2c 20 5c 63 6f 64 65 |EOFError|}, \code|
|00000ff0| 7b 56 61 6c 75 65 45 72 | 72 6f 72 7d 20 6f 72 20 |{ValueEr|ror} or |
|00001000| 5c 63 6f 64 65 7b 54 79 | 70 65 45 72 72 6f 72 7d |\code{Ty|peError}|
|00001010| 2e 20 20 45 78 74 72 61 | 0a 20 20 63 68 61 72 61 |. Extra|. chara|
|00001020| 63 74 65 72 73 20 69 6e | 20 74 68 65 20 73 74 72 |cters in| the str|
|00001030| 69 6e 67 20 61 72 65 20 | 69 67 6e 6f 72 65 64 2e |ing are |ignored.|
|00001040| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
+--------+-------------------------+-------------------------+--------+--------+