• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mixedmodule.MixedModule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: __init__

 def __init__(self, space, *args):
     "NOT_RPYTHON: patches space.threadlocals to use real threadlocals"
     from pypy.module.thread import gil
     MixedModule.__init__(self, space, *args)
     prev = space.threadlocals.getvalue()
     space.threadlocals = gil.GILThreadLocals()
     space.threadlocals.setvalue(prev)
开发者ID:antoine1fr,项目名称:pygirl,代码行数:7,代码来源:__init__.py


示例2: __init__

 def __init__(self, space, w_name):
     backend = space.config.translation.backend
     # the Win32 urandom implementation isn't going to translate on JVM or CLI
     # so we have to remove it
     if 'urandom' in self.interpleveldefs and (backend == 'cli' or backend == 'jvm'):
         del self.interpleveldefs['urandom']
     MixedModule.__init__(self, space, w_name)
开发者ID:alkorzt,项目名称:pypy,代码行数:7,代码来源:__init__.py


示例3: __init__

            def __init__(self, space, w_name):
                def loader(myspace):
                    assert myspace is space
                    return myspace.wrap("hello")

                MixedModule.__init__(self, space, w_name)
                self.loaders["hi"] = loader
开发者ID:junion,项目名称:butlerbot-unstable,代码行数:7,代码来源:test_appinterp.py


示例4: __init__

 def __init__(self, space, w_name):
     def create_lambda(name, alsoname):
         return lambda space : self.getdictvalue(space, space.wrap(alsoname))
     
     MixedModule.__init__(self, space, w_name)
     for name, alsoname in self.mapping.iteritems():
         self.loaders[name] = create_lambda(name, alsoname)
开发者ID:AishwaryaKM,项目名称:python-tutorial,代码行数:7,代码来源:__init__.py


示例5: __init__

 def __init__(self, space, *args):
     "NOT_RPYTHON"
     MixedModule.__init__(self, space, *args)
     from pypy.module.posix.interp_posix import add_fork_hook
     from pypy.module.imp import interp_imp
     add_fork_hook('before', interp_imp.acquire_lock)
     add_fork_hook('parent', interp_imp.release_lock)
     add_fork_hook('child', interp_imp.reinit_lock)
开发者ID:Qointum,项目名称:pypy,代码行数:8,代码来源:__init__.py


示例6: __init__

 def __init__(self, space, w_name):
     # if it's an ootype translation, remove all the defs that are lltype
     # only
     backend = space.config.translation.backend
     if backend == "cli" or backend == "jvm":
         for name in lltype_only_defs:
             self.interpleveldefs.pop(name, None)
     MixedModule.__init__(self, space, w_name)
开发者ID:pombredanne,项目名称:pypy,代码行数:8,代码来源:__init__.py


示例7: __init__

    def __init__(self, space, *args):
        "NOT_RPYTHON"
        MixedModule.__init__(self, space, *args)

        # pythonization functions may be written in RPython, but the interp2app
        # code generation is not, so give it a chance to run now
        from pypy.module.cppyy import capi
        capi.register_pythonizations(space)
开发者ID:Darriall,项目名称:pypy,代码行数:8,代码来源:__init__.py


示例8: init

 def init(self, space):
     MixedModule.init(self, space)
     w_UnsupportedOperation = space.call_function(
         space.w_type,
         space.wrap('UnsupportedOperation'),
         space.newtuple([space.w_ValueError, space.w_IOError]),
         space.newdict())
     space.setattr(self, space.wrap('UnsupportedOperation'),
                   w_UnsupportedOperation)
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:9,代码来源:__init__.py


示例9: __init__

 def __init__(self, space, *args):
     "NOT_RPYTHON"
     from pypy.module.signal import interp_signal
     MixedModule.__init__(self, space, *args)
     # add the signal-checking callback as an action on the space
     space.check_signal_action = interp_signal.CheckSignalAction(space)
     space.actionflag.register_periodic_action(space.check_signal_action,
                                               use_bytecode_counter=False)
     space.actionflag.__class__ = interp_signal.SignalActionFlag
开发者ID:Debug-Orz,项目名称:Sypy,代码行数:9,代码来源:__init__.py


示例10: __init__

 def __init__(self, space, *args):
     "NOT_RPYTHON: patches space.threadlocals to use real threadlocals"
     from pypy.module.thread import gil
     MixedModule.__init__(self, space, *args)
     prev = space.threadlocals.getvalue()
     space.threadlocals = gil.GILThreadLocals()
     space.threadlocals.setvalue(prev)
     space.threadlocals.enter_thread(space)   # setup the main thread
     # add the GIL-releasing callback as an action on the space
     space.pending_actions.append(gil.GILReleaseAction(space.threadlocals))
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:10,代码来源:__init__.py


示例11: __init__

    def __init__(self, space, *args):
        "NOT_RPYTHON"

        # mbcs codec is Windows specific, and based on rffi.
        if (hasattr(runicode, 'str_decode_mbcs')):
            self.interpleveldefs['mbcs_encode'] = 'interp_codecs.mbcs_encode'
            self.interpleveldefs['mbcs_decode'] = 'interp_codecs.mbcs_decode'

        MixedModule.__init__(self, space, *args)

        interp_codecs.register_builtin_error_handlers(space)
开发者ID:charred,项目名称:pypy,代码行数:11,代码来源:__init__.py


示例12: __init__

    def __init__(self, space, *args):
        "NOT_RPYTHON: patches space.threadlocals to use real threadlocals"
        from pypy.module.thread import gil
        MixedModule.__init__(self, space, *args)
        prev = space.threadlocals.getvalue()
        space.threadlocals = gil.GILThreadLocals()
        space.threadlocals.initialize(space)
        space.threadlocals.setvalue(prev)

        from pypy.module.posix.interp_posix import add_fork_hook
        from pypy.module.thread.os_thread import reinit_threads
        add_fork_hook('child', reinit_threads)
开发者ID:Sherlockhlt,项目名称:pypy,代码行数:12,代码来源:__init__.py


示例13: getdictvalue

 def getdictvalue(self, space, w_attr): 
     """ specialize access to dynamic exc_* attributes. """ 
     value = MixedModule.getdictvalue(self, space, w_attr) 
     if value is not None: 
         return value
     attr = space.str_w(w_attr)
     if attr == 'exc_type':
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return operror.w_type
     elif attr == 'exc_value':
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return operror.w_value
     elif attr == 'exc_traceback':
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return space.wrap(operror.application_traceback)
     return None 
开发者ID:TheDunn,项目名称:flex-pypy,代码行数:25,代码来源:__init__.py


示例14: __init__

 def __init__(self, space, w_name):
     if (not space.config.translating or
         space.config.translation.gctransformer == "framework"):
         self.appleveldefs.update({
             'dump_rpy_heap': 'app_referents.dump_rpy_heap',
             })
         self.interpleveldefs.update({
             'get_rpy_roots': 'referents.get_rpy_roots',
             'get_rpy_referents': 'referents.get_rpy_referents',
             'get_rpy_memory_usage': 'referents.get_rpy_memory_usage',
             'get_rpy_type_index': 'referents.get_rpy_type_index',
             'get_objects': 'referents.get_objects',
             'get_referents': 'referents.get_referents',
             'get_referrers': 'referents.get_referrers',
             '_dump_rpy_heap': 'referents._dump_rpy_heap',
             'get_typeids_z': 'referents.get_typeids_z',
             'GcRef': 'referents.W_GcRef',
             })
     MixedModule.__init__(self, space, w_name)
开发者ID:gorakhargosh,项目名称:pypy,代码行数:19,代码来源:__init__.py


示例15: getdictvalue

 def getdictvalue(self, space, attr):
     """ specialize access to dynamic exc_* attributes. """
     value = MixedModule.getdictvalue(self, space, attr)
     if value is not None:
         return value
     if attr == "exc_type":
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return operror.w_type
     elif attr == "exc_value":
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return operror.get_w_value(space)
     elif attr == "exc_traceback":
         operror = space.getexecutioncontext().sys_exc_info()
         if operror is None:
             return space.w_None
         else:
             return space.wrap(operror.get_traceback())
     return None
开发者ID:junion,项目名称:butlerbot-unstable,代码行数:24,代码来源:__init__.py


示例16: shutdown

 def shutdown(self, space):
     from pypy.module.faulthandler import handler
     handler.finish(space)
     MixedModule.shutdown(self, space)
开发者ID:mozillazg,项目名称:pypy,代码行数:4,代码来源:__init__.py


示例17: init

 def init(self, space):
     MixedModule.init(self, space)
     from pypy.module._multiprocessing.interp_connection import State
     space.fromcache(State).init(space)
开发者ID:abhinavthomas,项目名称:pypy,代码行数:4,代码来源:__init__.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pycode.PyCode类代码示例发布时间:2022-05-27
下一篇:
Python gateway.interp2app_temp函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap