File: moduledef.py

package info (click to toggle)
pypy3 7.3.19%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212,236 kB
  • sloc: python: 2,098,316; ansic: 540,565; sh: 21,462; asm: 14,419; cpp: 4,451; makefile: 4,209; objc: 761; xml: 530; exp: 499; javascript: 314; pascal: 244; lisp: 45; csh: 12; awk: 4
file content (37 lines) | stat: -rw-r--r-- 1,521 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule

class Module(MixedModule):
    """
    This module contains functions that can read and write Python values in
    a binary format. The format is specific to Python, but independent of
    machine architecture issues.

    Not all Python object types are supported; in general, only objects
    whose value is independent from a particular invocation of Python can be
    written and read by this module. The following types are supported:
    None, integers, floating point numbers, strings, bytes, bytearrays,
    tuples, lists, sets, dictionaries, and code objects, where it
    should be understood that tuples, lists and dictionaries are only
    supported as long as the values contained therein are themselves
    supported; and recursive lists and dictionaries should not be written
    (they will cause infinite loops).

    Variables:
     
    version -- indicates the format that the module uses. Version 0 is the
        historical format, version 1 shares interned strings and version 2
        uses a binary format for floating point numbers.
        Version 3 shares common object references (New in version 3.4).
    """

    appleveldefs = {
    }

    interpleveldefs = {
        'dump'    : 'interp_marshal.dump',
        'dumps'   : 'interp_marshal.dumps',
        'load'    : 'interp_marshal.load',
        'loads'   : 'interp_marshal.loads',
        'version' : 'space.newint(interp_marshal.Py_MARSHAL_VERSION)',
    }