Skip to content

Commit 137dd64

Browse files
authored
Merge pull request #427 from rocky/make-fn-or-closure-with-annotatation
try to be more honest about MAKE_{FUNCTION,CLOSURE}
2 parents 154dabf + 9a7eb0a commit 137dd64

File tree

5 files changed

+123
-103
lines changed

5 files changed

+123
-103
lines changed

uncompyle6/parser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,16 @@ def error(self, instructions, index):
213213
raise ParserError(None, -1, self.debug["reduce"])
214214

215215
def get_pos_kw(self, token):
216-
"""Return then the number of positional parameters and
217-
represented by the attr field of token"""
216+
"""
217+
Return then the number of positional parameters and keyword
218+
parfameters represented by the attr (operand) field of
219+
token.
220+
221+
This appears in CALL_FUNCTION or CALL_METHOD (PyPy) tokens
222+
"""
218223
# Low byte indicates number of positional paramters,
219224
# high byte number of keyword parameters
225+
assert token.kind.startswith("CALL_FUNCTION") or token.kind.startswith("CALL_METHOD")
220226
args_pos = token.attr & 0xFF
221227
args_kw = (token.attr >> 8) & 0xFF
222228
return args_pos, args_kw

0 commit comments

Comments
 (0)