本文整理汇总了Python中pypy.interpreter.mixedmodule.MixedModule.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python MixedModule.__init__方法的具体用法?Python MixedModule.__init__怎么用?Python MixedModule.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.interpreter.mixedmodule.MixedModule
的用法示例。
在下文中一共展示了MixedModule.__init__方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例2: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例3: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例4: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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
示例5: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例6: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例7: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例8: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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
示例9: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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))
示例10: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例11: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)
示例12: __init__
# 需要导入模块: from pypy.interpreter.mixedmodule import MixedModule [as 别名]
# 或者: from pypy.interpreter.mixedmodule.MixedModule import __init__ [as 别名]
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)