2222a different version than the currently-running Python.
2323
2424When the running interpreter and the read-in bytecode are the same,
25- you can simply use Python's built-in marshal.loads() to produce a code
26- object
25+ you can use Python's built-in `` marshal.loads()`` to produce a code
26+ object.
2727"""
2828
2929import io
@@ -54,14 +54,14 @@ def long(n):
5454FLAG_REF = 0x80
5555
5656
57- # The keys in following dictionary are an unmashal codes, like "s",
58- # "c", "<", etc. the values of the dictionary are names of routines
57+ # The keys in the following dictionary are unmarshal codes, like "s",
58+ # "c", "<", etc. The values of the dictionary are names of routines
5959# to call that do the data unmarshaling.
6060#
61- # Note: we could eliminate the parameters, if this were all inside a
61+ # Note: we could eliminate the parameters if this were all inside a
6262# class. This might be good from an efficiency standpoint, and bad
6363# from a functional-programming standpoint. Pick your poison.
64- # EDIT: I'm choosing efficiency over functional- programming.
64+ # EDIT: I'm choosing efficiency over functional programming.
6565UNMARSHAL_DISPATCH_TABLE = {
6666 "0" : "C_NULL" ,
6767 "N" : "None" ,
@@ -116,10 +116,10 @@ def compat_str(s: Union[str, bytes]) -> Union[str, bytes]:
116116
117117def compat_u2s (u ):
118118 if PYTHON_VERSION_TRIPLE < (3 , 0 ):
119- # See also unaccent.py which can be found using google . I
119+ # See also `` unaccent.py`` which can be found using Google . I
120120 # found it and this code via
121121 # https://www.peterbe.com/plog/unicode-to-ascii where it is a
122- # dead link. That can potentially do better job in converting accents.
122+ # dead link. That can potentially do a better job in converting accents.
123123 s = unicodedata .normalize ("NFKD" , u )
124124 try :
125125 return s .encode ("ascii" )
@@ -139,7 +139,7 @@ def __init__(self, fp, magic_int, bytes_for_s, code_objects={}):
139139 3: [3.4a0, 3.4a3) (self.magic_int: 3250 until 3280)
140140 4: [3.4a3, current) (self.magic_int: 3280 onwards)
141141
142- In Python 3 a bytes type is used for strings.
142+ In Python 3, a `` bytes`` type is used for strings.
143143 """
144144 self .fp = fp
145145 self .magic_int = magic_int
@@ -167,7 +167,7 @@ def __init__(self, fp, magic_int, bytes_for_s, code_objects={}):
167167
168168 def load (self ):
169169 """
170- marshal.load() written in Python. When the Python bytecode magic loaded is the
170+ `` marshal.load()`` written in Python. When the Python bytecode magic loaded is the
171171 same magic for the running Python interpreter, we can simply use the
172172 Python-supplied marshal.load().
173173
@@ -316,8 +316,8 @@ def t_binary_complex(self, save_ref, bytes_for_s=False):
316316 # Note: could mean bytes in Python3 processing Python2 bytecode
317317 def t_string (self , save_ref , bytes_for_s : bool ):
318318 """
319- In Python3 this is a bytes types. In Python2 it is a string.
320- `bytes_for_s` distinguishes what we need.
319+ In Python3, this is a `` bytes`` type. In Python2, it is a string type;
320+ `` bytes_for_s` ` distinguishes what we need.
321321 """
322322 strsize = unpack ("<i" , self .fp .read (4 ))[0 ]
323323 s = self .fp .read (strsize )
0 commit comments