当前位置: 首页>>代码示例>>Python>>正文


Python debug.make_sure_not_resized函数代码示例

本文整理汇总了Python中pypy.rlib.debug.make_sure_not_resized函数的典型用法代码示例。如果您正苦于以下问题:Python make_sure_not_resized函数的具体用法?Python make_sure_not_resized怎么用?Python make_sure_not_resized使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了make_sure_not_resized函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: pushrevvalues

 def pushrevvalues(self, n, values_w): # n should be len(values_w)
     make_sure_not_resized(values_w)
     while True:
         n -= 1
         if n < 0:
             break
         self.pushvalue(values_w[n])
开发者ID:enyst,项目名称:plexnet,代码行数:7,代码来源:pyframe.py

示例2: overwrite

 def overwrite(self, pos, listofchars):
     make_sure_not_resized(listofchars)
     assert pos + len(listofchars) <= self._size
     for c in listofchars:
         self._data[pos] = c
         pos += 1
     return pos
开发者ID:alkorzt,项目名称:pypy,代码行数:7,代码来源:codebuf.py

示例3: packimm32

def packimm32(i):
    lst = [chr(i & 0xFF),
           chr((i >> 8) & 0xFF),
           chr((i >> 16) & 0xFF),
           chr((i >> 24) & 0xFF)]
    make_sure_not_resized(lst)
    return lst
开发者ID:alkorzt,项目名称:pypy,代码行数:7,代码来源:ri386.py

示例4: __init__

 def __init__(self, space, code, w_globals, outer_func):
     if not we_are_translated():
         assert type(self) in (space.FrameClass, CPythonFrame), (
             "use space.FrameClass(), not directly PyFrame()")
     self = hint(self, access_directly=True, fresh_virtualizable=True)
     assert isinstance(code, pycode.PyCode)
     self.pycode = code
     eval.Frame.__init__(self, space, w_globals)
     self.locals_stack_w = [None] * (code.co_nlocals + code.co_stacksize)
     
     # Symbolic stack, globals tracker and constraint stack
     self.locals_stack_w_s = [None] * (code.co_nlocals + code.co_stacksize)
     self.w_globals_s = w_globals
     
     self.valuestackdepth = code.co_nlocals
     self.lastblock = None
     make_sure_not_resized(self.locals_stack_w)
     check_nonneg(self.valuestackdepth)
     #
     if space.config.objspace.honor__builtins__:
         self.builtin = space.builtin.pick_builtin(w_globals)
     # regular functions always have CO_OPTIMIZED and CO_NEWLOCALS.
     # class bodies only have CO_NEWLOCALS.
     self.initialize_frame_scopes(outer_func, code)
     self.f_lineno = code.co_firstlineno
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:25,代码来源:pyframe.py

示例5: __init__

 def __init__(self, opnum, args, result, descr=None):
     make_sure_not_resized(args)
     assert isinstance(opnum, int)
     self.opnum = opnum
     self.args = list(args)
     make_sure_not_resized(self.args)
     assert not isinstance(result, list)
     self.result = result
     self.setdescr(descr)
开发者ID:alkorzt,项目名称:pypy,代码行数:9,代码来源:resoperation.py

示例6: __init__

 def __init__(self, space, dim, dtype):
     self.dim = dim
     self.space = space
     # ignore dtype for now
     size = 1
     for el in dim:
         size *= el
     self.storage = [0] * size
     make_sure_not_resized(self.storage)
开发者ID:enyst,项目名称:plexnet,代码行数:9,代码来源:numarray.py

示例7: __init__

 def __init__(self, space, args_w, kwds_w=None,
              w_stararg=None, w_starstararg=None):
     self.space = space
     assert isinstance(args_w, list)
     self.arguments_w = args_w
     from pypy.rlib.debug import make_sure_not_resized
     make_sure_not_resized(self.arguments_w)
     self.kwds_w = kwds_w
     self.w_stararg = w_stararg
     self.w_starstararg = w_starstararg
开发者ID:AishwaryaKM,项目名称:python-tutorial,代码行数:10,代码来源:argument.py

示例8: __init__

 def __init__(self, space, code, w_globals=None, defs_w=[], closure=None, forcename=None):
     self.space = space
     self.name = forcename or code.co_name
     self.w_doc = None   # lazily read from code.getdocstring()
     self.code = code       # Code instance
     self.w_func_globals = w_globals  # the globals dictionary
     self.closure   = closure    # normally, list of Cell instances or None
     self.defs_w    = defs_w     # list of w_default's
     make_sure_not_resized(self.defs_w)
     self.w_func_dict = None # filled out below if needed
     self.w_module = None
开发者ID:enyst,项目名称:plexnet,代码行数:11,代码来源:function.py

示例9: args_hash

def args_hash(args):
    make_sure_not_resized(args)
    res = 0x345678
    for arg in args:
        if arg is None:
            y = 17
        elif isinstance(arg, history.Const):
            y = arg._get_hash_()
        else:
            y = compute_identity_hash(arg)
        res = intmask((1000003 * res) ^ y)
    return res
开发者ID:gorakhargosh,项目名称:pypy,代码行数:12,代码来源:util.py

示例10: __init__

 def __init__(self, space, code, w_globals, closure):
     self = hint(self, access_directly=True, fresh_virtualizable=True)
     assert isinstance(code, pycode.PyCode)
     self.pycode = code
     eval.Frame.__init__(self, space, w_globals, code.co_nlocals)
     self.valuestack_w = [None] * code.co_stacksize
     self.valuestackdepth = 0
     self.lastblock = None
     if space.config.objspace.honor__builtins__:
         self.builtin = space.builtin.pick_builtin(w_globals)
     # regular functions always have CO_OPTIMIZED and CO_NEWLOCALS.
     # class bodies only have CO_NEWLOCALS.
     self.initialize_frame_scopes(closure, code)
     self.fastlocals_w = [None] * self.numlocals
     make_sure_not_resized(self.fastlocals_w)
     self.f_lineno = code.co_firstlineno
开发者ID:alkorzt,项目名称:pypy,代码行数:16,代码来源:pyframe.py

示例11: args_eq

def args_eq(args1, args2):
    make_sure_not_resized(args1)
    make_sure_not_resized(args2)
    if len(args1) != len(args2):
        return False
    for i in range(len(args1)):
        arg1 = args1[i]
        arg2 = args2[i]
        if isinstance(arg1, history.Const):
            if arg1.__class__ is not arg2.__class__:
                return False
            if not arg1.same_constant(arg2):
                return False
        else:
            if not arg1 is arg2:
                return False
    return True
开发者ID:gorakhargosh,项目名称:pypy,代码行数:17,代码来源:util.py

示例12: __init__

    def __init__(self, parent, func, pc, max_stack_size, nargs, bc_off, closure):
        self = jit.hint(self, access_directly=True, fresh_virtualizable=True)
        self.parent = parent
        self.stack = [None] * max_stack_size
        debug.make_sure_not_resized(self.stack)
        self.func = func
        self.pc = pc
        self.nargs = nargs # Number of arguments passed to this continuation
        self.bc_off = bc_off # -1 for Py modules
        self.closure = closure
        self.returned = False

        # stackpe always points to the element *after* the end of the stack (this makes a lot of
        # stack-based operations quicker)
        self.stackpe = 0
        # ffp, gfp, and xfp all point *to* the frame they refer to
        self.ffp = self.gfp = self.xfp = -1
开发者ID:cfbolz,项目名称:converge,代码行数:17,代码来源:VM.py

示例13: fixedview

 def fixedview(self, w_obj, expected_length=-1, unroll=False):
     """ Fast paths
     """
     if isinstance(w_obj, W_AbstractTupleObject):
         t = w_obj.tolist()
     elif type(w_obj) is W_ListObject:
         if unroll:
             t = w_obj.getitems_unroll()
         else:
             t = w_obj.getitems_fixedsize()
     else:
         if unroll:
             return make_sure_not_resized(ObjSpace.unpackiterable_unroll(
                 self, w_obj, expected_length))
         else:
             return make_sure_not_resized(ObjSpace.unpackiterable(
                 self, w_obj, expected_length)[:])
     if expected_length != -1 and len(t) != expected_length:
         raise self._wrap_expected_length(expected_length, len(t))
     return make_sure_not_resized(t)
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:20,代码来源:objspace.py

示例14: __init__

    def __init__(self, space, args_w, keywords=None, keywords_w=None,
                 w_stararg=None, w_starstararg=None):
        self.space = space
        assert isinstance(args_w, list)
        self.arguments_w = args_w
        self.keywords = keywords
        self.keywords_w = keywords_w
        if keywords is not None:
            assert keywords_w is not None
            assert len(keywords_w) == len(keywords)
            make_sure_not_resized(self.keywords)
            make_sure_not_resized(self.keywords_w)

        make_sure_not_resized(self.arguments_w)
        if w_stararg is not None or w_starstararg is not None:
            self._combine_wrapped(w_stararg, w_starstararg)
开发者ID:enyst,项目名称:plexnet,代码行数:16,代码来源:argument.py

示例15: __init__

    def __init__(self, space, args_w, keywords=None, keywords_w=None,
                 w_stararg=None, w_starstararg=None):
        self.space = space
        assert isinstance(args_w, list)
        self.arguments_w = args_w
        self.keywords = keywords
        self.keywords_w = keywords_w
        if keywords is not None:
            assert keywords_w is not None
            assert len(keywords_w) == len(keywords)
            make_sure_not_resized(self.keywords)
            make_sure_not_resized(self.keywords_w)

        make_sure_not_resized(self.arguments_w)
        if w_stararg is not None or w_starstararg is not None:
            self._combine_wrapped(w_stararg, w_starstararg)
            # if we have a call where * or ** args are used at the callsite
            # we shouldn't let the JIT see the argument matching
            self._dont_jit = True
        else:
            self._dont_jit = False
开发者ID:alkorzt,项目名称:pypy,代码行数:21,代码来源:argument.py


注:本文中的pypy.rlib.debug.make_sure_not_resized函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。