Useful Bytecode

def error(msg):
    raise OMPCException(msg)

def _check_nargout(nargout, maxout):
    if nargout > maxout:
        error("Too manu output arguments!")

def test_ninout(b=None,c=None):
    out1, out2 = None, None
    nargin, nargout = _get_narginout()
    _check_nargout(nargout, 2)

[(LOAD_GLOBAL, '_check_nargout'),
 (LOAD_FAST, 'nargout'),
 (LOAD_CONST, 2),
 (CALL_FUNCTION, 2),]
Comments