MCPcopy Index your code
hub / github.com/rocky/python-uncompyle6 / get_pos_kw

Method get_pos_kw

uncompyle6/parser.py:224–239  ·  view source on GitHub ↗

Return then the number of positional parameters and keyword parfameters represented by the attr (operand) field of token. This appears in CALL_FUNCTION or CALL_METHOD (PyPy) tokens

(self, token)

Source from the content-addressed store, hash-verified

222 raise ParserError(None, -1, self.debug["reduce"])
223
224 def get_pos_kw(self, token):
225 """
226 Return then the number of positional parameters and keyword
227 parfameters represented by the attr (operand) field of
228 token.
229
230 This appears in CALL_FUNCTION or CALL_METHOD (PyPy) tokens
231 """
232 # Low byte indicates number of positional parameters,
233 # high byte number of keyword parameters
234 assert token.kind.startswith("CALL_FUNCTION") or token.kind.startswith(
235 "CALL_METHOD"
236 )
237 args_pos = token.attr & 0xFF
238 args_kw = (token.attr >> 8) & 0xFF
239 return args_pos, args_kw
240
241 def nonterminal(self, nt, args):
242 n = len(args)

Callers 9

custom_classfunc_ruleMethod · 0.80
custom_classfunc_ruleMethod · 0.80
custom_classfunc_ruleMethod · 0.80
custom_classfunc_ruleMethod · 0.80
custom_classfunc_ruleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected