code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
"""
Implementation of interpreter-level 'sys' routines.
"""
from pypy.interpreter.error import OperationError
import sys
# ____________________________________________________________
def setbuiltinmodule(w_module, name):
""" put a module into the modules builtin_modules dicts """
if builtin_modules[name] is ... | Python |
"""
Implementation of interpreter-level 'sys' routines.
"""
import pypy
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import ObjSpace
import sys, os, stat, errno
# ____________________________________________________________
#
class State:
def __init__(self, space):
se... | Python |
from pypy.interpreter.pyopcode import print_item_to, print_newline_to, sys_stdout
def displayhook(space, w_obj):
"""Print an object to sys.stdout and also save it in __builtin__._"""
if not space.is_w(w_obj, space.w_None):
space.setitem(space.builtin.w_dict, space.wrap('_'), w_obj)
# NB. this... | Python |
"""
Version numbers exposed by PyPy through the 'sys' module.
"""
import os
CPYTHON_VERSION = (2, 4, 1, "alpha", 42)
CPYTHON_API_VERSION = 1012
PYPY_VERSION = (1, 0, 0, "alpha", '?')
# the last item is replaced by the svn revision ^^^
SVN_URL = "$HeadURL: https://codespeak.net/svn/py... | Python |
from pypy.interpreter.mixedmodule import MixedModule
from pypy.interpreter.error import OperationError
class Module(MixedModule):
"""Sys Builtin Module. """
def __init__(self, space, w_name):
"""NOT_RPYTHON""" # because parent __init__ isn't
super(Module, self).__init__(space, w_name)
... | Python |
"""
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need
to be run, typically all of the test subdirs.
The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing "pypy"
is in sys.path.
If y... | Python |
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.typedef import GetSetProperty, TypeDef
from pypy.interpreter.typedef import interp_attrproperty, interp_attrproperty_w
from pypy.interpreter.gateway import interp2app, ObjSpace, W_Root
from pypy.interpreter.error import OperationError
from pypy.r... | Python |
class GreenletExit(Exception):
pass
class GreenletError(Exception):
pass
| Python |
"""
Coroutine implementation for application level on top
of the internal coroutines.
This is an extensible concept. Multiple implementations
of concurrency can exist together, if they follow the
basic concept of maintaining their own costate.
There is also some diversification possible by using
multiple costates for ... | Python |
"""
Basic Concept:
--------------
All concurrency is expressed by some means of coroutines.
This is the lowest possible exposable interface.
A coroutine is a structure that controls a sequence
of continuations in time. It contains a frame object
that is a restartable stack chain. This frame object
is updated on every... | Python |
"""
basic definitions for tasklet flags.
For simplicity and compatibility,
they are defined the same for coroutines,
even if they are not used.
taken from tasklet_structs.h
----------------------------
/***************************************************************************
Tasklet Flag Definition
------... | Python |
from pypy.interpreter.argument import Arguments
from pypy.interpreter.typedef import GetSetProperty, TypeDef
from pypy.interpreter.gateway import interp2app, ObjSpace, W_Root
from pypy.interpreter.gateway import NoneNotWrapped
from pypy.interpreter.error import OperationError
from pypy.module._stackless.interp_corouti... | Python |
from pypy.module._stackless.interp_coroutine import AbstractThunk, Coroutine
from pypy.rlib.rgc import gc_swap_pool, gc_clone
from pypy.rlib.objectmodel import we_are_translated
from pypy.interpreter.error import OperationError
class InterpClonableMixin:
local_pool = None
_mixin_ = True
def hello_local_p... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
"""
This module implements Stackless for applications.
"""
appleveldefs = {
'GreenletExit' : 'app_greenlet.GreenletExit',
'GreenletError' : 'app_greenlet.GreenletError',
}
... | Python |
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.typedef import TypeDef, interp2app
from pypy.module._stackless.coroutine import AppCoState, AppCoroutine
class W_UserCoState(Wrappable):
def __init__(self, space):
self.costate = AppCoState(space)
self.costate.post_install()... | Python |
from pypy.interpreter.error import OperationError
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway import interp2app, ObjSpace, W_Root
from pypy.module._stackless.coroutine import AppCoroutine, AppCoState
from pypy.module._stackless.coroutine import makeStaticMethod
from pypy.module._stackless... | Python |
from pypy.conftest import gettestobjspace
# app-level testing of coroutine pickling
class AppTest_Pickle:
def setup_class(cls):
space = gettestobjspace(usemodules=('_stackless',))
cls.space = space
def test_simple_ish(self):
output = []
import _stackless
def f(coro, ... | Python |
# | Python |
""" The ffi for rpython, need to be imported for side effects
"""
import sys
from pypy.rpython.lltypesystem import rffi
from pypy.rpython.lltypesystem import lltype
from pypy.rpython.extfunc import register_external
from pypy.rpython.extregistry import ExtRegistryEntry
from pypy.module._curses import interp_curses
fr... | Python |
class error(Exception):
pass
| Python |
from pypy.interpreter.baseobjspace import ObjSpace, W_Root
from pypy.interpreter.error import OperationError
import _curses
class ModuleInfo:
def __init__(self):
self.setupterm_called = False
module_info = ModuleInfo()
class curses_error(Exception):
def __init__(self, msg):
self.msg = msg
... | Python |
from pypy.interpreter.mixedmodule import MixedModule
from pypy.module._curses import fficurses
from pypy.module._curses import interp_curses
from pypy.rlib.nonconst import NonConstant
import _curses
class Module(MixedModule):
""" Low-level interface for curses module,
not meant to be used directly
"""
... | Python |
import time
from pypy.interpreter.gateway import ObjSpace
def clock(space):
"""Return the CPU time or real time since the start of the process or
since the first call to clock(). This returns a floating point measured
in seconds with as much precision as the system records."""
return space.wrap(time.clock())... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
import time
class Module(MixedModule):
"""time module"""
appleveldefs = {
}
interpleveldefs = {
'clock' : 'interp_time.clock',
'time' : 'interp_time.time_',
'sleep' : 'interp_time.sleep',
}
| Python |
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import ObjSpace
from pypy.rlib.objectmodel import we_are_translated
def internal_repr(space, w_object):
return space.wrap('%r' % (w_object,))
def isfake(space, w_obj):
"""Return whether the argument is faked (stolen from CPython).... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
appleveldefs = {
}
interpleveldefs = {
'internal_repr' : 'interp_magic.internal_repr',
}
def setup_after_space_initialization(self):
if not self.space.config.trans... | Python |
#
| Python |
"""Compatibility layer for CPython's parser module"""
from pypy.interpreter.pyparser.tuplebuilder import TupleBuilder
from pythonparse import make_pyparser
from pythonutil import pypy_parse
import symbol # XXX use PYTHON_PARSER.symbols ?
from compiler import transformer, compile as pycompile
PYTHON_PARSER = make_pypa... | Python |
# ______________________________________________________________________
# ParserError exception
class ParserError (Exception):
"""Class ParserError
Exception class for parser errors (I assume).
"""
class ASTVisitor(object):
"""This is a visitor base class used to provide the visit
method in repl... | Python |
"""this one logs simple assignments and somewhat clearly shows
that we need a nice API to define "joinpoints". Maybe a SAX-like
(i.e. event-based) API ?
XXX: crashes on everything else than simple assignment (AssAttr, etc.)
"""
from parser import ASTPrintnl, ASTConst, ASTName, ASTAssign, ASTMutator
from parser import... | Python |
import parser
class ConstMutator(parser.ASTMutator):
def visitConst(self, node):
if node.value == 3:
node.value = 2
return node
def threebecomestwo(ast, enc, filename):
ast.mutate(ConstMutator())
return ast
# install the hook
parser.install_compiler_hook(threebecomestwo)
print ... | Python |
# Copyright (c) 2000-2003 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
"""
"""
__revision__ = "$Id: $"
import pythonutil
from compiler.visitor import ASTVisitor
from compiler.bytecode import *
def compile(source, filename, mode, flags=None, dont_inherit=None):
"""Replaceme... | Python |
# Emulation layer for the recparser module
# make it so that pyparser matches the 'parser' module interface
from pypy.interpreter.baseobjspace import ObjSpace, Wrappable, W_Root
from pypy.interpreter.gateway import interp2app, applevel
from pypy.interpreter.error import OperationError
from pypy.interpreter.typedef imp... | Python |
from pypy.interpreter.error import OperationError, debug_print
import pypy.interpreter.pyparser.pythonparse
from pypy.interpreter.mixedmodule import MixedModule
# Forward imports so they run at startup time
import pyparser
import pypy.interpreter.pyparser.pythonlexer
import pypy.interpreter.pyparser.pythonparse
impo... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
"""
This module implements marshal at interpreter level.
"""
appleveldefs = {
}
interpleveldefs = {
'dump' : 'interp_marshal.dump',
'dumps' : 'interp_marshal.dumps... | Python |
from pypy.interpreter.baseobjspace import ObjSpace
from pypy.interpreter.error import OperationError
from pypy.rlib.rarithmetic import intmask
import sys
# Py_MARSHAL_VERSION = 2
# this is from Python 2.5
# already implemented, but for compatibility,
# we default to version 1. Version 2 can be
# tested, anyway, by usi... | Python |
TESTCASES = """\
None
False
True
StopIteration
Ellipsis
42
-17
sys.maxint
-1.25
-1.25 #2
2+5j
2+5j #2
42L
-1234567890123456789012345678901234567890L
hello # not interned
"hello"
()
(1, 2)
[]
[3, 4]
{}
{5: 6, 7: 8}
func.func_c... | Python |
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import W_Root, ObjSpace
from pypy.interpreter.miscutils import Action
import signal as cpy_signal
def setup():
for key, value in cpy_signal.__dict__.items():
if key.startswith('SIG') and isinstance(value, int):
... | Python |
def default_int_handler(signum, frame):
"""
default_int_handler(...)
The default handler for SIGINT installed by Python.
It raises KeyboardInterrupt.
"""
raise KeyboardInterrupt()
| Python |
from pypy.rpython.rctypes.tool import ctypes_platform
from pypy.rpython.rctypes.tool.libc import libc
from ctypes import *
assert 0, "not used so far =============================================="
signal_names = ['SIGINT', 'SIGTERM', 'SIGKILL',
# ...
]
sighandler_t = CFUNCTYPE(Non... | Python |
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
interpleveldefs = {
'signal': 'interp_signal.signal',
'getsignal': 'interp_signal.getsignal',
'NSIG': 'space.wrap(interp_signal.NSIG)',
'SIG_DFL': 'spac... | Python |
# NOT_RPYTHON
from cclp import _make_expression
def make_expression(variables, formula):
func = 'lambda %s:%s' % (','.join([name_of(var)
for var in variables]),
formula)
return _make_expression(variables, formula, eval(func))
| Python |
from pypy.interpreter import baseobjspace, gateway, typedef
from pypy.interpreter.error import OperationError
from pypy.module._stackless.clonable import AppClonableCoroutine
from pypy.module.cclp.misc import w, AppCoroutine, get_current_cspace
from pypy.module.cclp.global_state import sched
from pypy.rlib.rgc import... | Python |
from pypy.interpreter import gateway, baseobjspace
from pypy.objspace.std.listobject import W_ListObject
from pypy.objspace.std.stringobject import W_StringObject
from pypy.module.cclp.types import deref, W_Var, W_CVar
from pypy.module.cclp.variable import bind_mm, raise_unification_failure, _alias, \
_assign_ali... | Python |
from pypy.interpreter import baseobjspace
from pypy.interpreter.function import Function
from pypy.interpreter.error import OperationError
from pypy.objspace.std.listobject import W_ListObject
from pypy.objspace.std.stringobject import W_StringObject
from pypy.module.cclp.types import W_CVar
def check_variables(spa... | Python |
#
| Python |
from pypy.module.cclp.types import W_Var
from pypy.module.cclp.interp_var import interp_bind, interp_free
from pypy.module._cslib import fd
class _DorkFiniteDomain(fd._FiniteDomain):
"""
this variant accomodates synchronization needs
of the dorkspace
"""
def __init__(self, space, w_values, value... | Python |
from pypy.interpreter import gateway, baseobjspace, argument
from pypy.rlib.objectmodel import we_are_translated
from pypy.module.cclp.types import W_Var, W_Future, W_FailedValue
from pypy.module.cclp.misc import w, v, AppCoroutine, get_current_cspace
from pypy.module.cclp.thunk import FutureThunk, ProcedureThunk
from... | Python |
from pypy.interpreter import gateway, baseobjspace
from pypy.interpreter.error import OperationError
from pypy.objspace.std.model import StdObjSpaceMultiMethod
from pypy.objspace.std.listobject import W_ListObject, W_TupleObject
from pypy.objspace.std.dictobject import W_DictObject
from pypy.objspace.std.stringobject i... | Python |
class State: pass
sched = State()
| Python |
from pypy.interpreter import gateway, baseobjspace
from pypy.rlib.objectmodel import we_are_translated
# commonly imported there, used from types, variable, thread
from pypy.module._stackless.coroutine import AppCoroutine
import os
class State: pass
NO_DEBUG_INFO = State()
NO_DEBUG_INFO.state = True
def w(*msgs):
... | Python |
from pypy.module._stackless.coroutine import _AppThunk, AppCoroutine
from pypy.module._stackless.interp_coroutine import AbstractThunk
from pypy.module.cclp.misc import w, get_current_cspace
from pypy.module.cclp.global_state import sched
from pypy.module.cclp.types import W_Var, W_CVar, W_Future, W_FailedValue, \
... | Python |
from pypy.module.cclp.variable import wait__Var, _assign_aliases, _entail
from pypy.module.cclp.types import W_Root, W_Var, W_CVar
from pypy.module.cclp.global_state import sched
from pypy.module.cclp.misc import w
def interp_free(w_var):
assert isinstance(w_var, W_Var)
return isinstance(w_var.w_bound_to, W_V... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
"""
This module implements concurrent constraint logic programming for applications.
"""
appleveldefs = {
'make_expression':'app.make_expression'
}
interpleveldefs = {
'swi... | Python |
from pypy.rlib.objectmodel import we_are_translated
from pypy.interpreter import baseobjspace, gateway, argument, typedef
from pypy.interpreter.error import OperationError
from pypy.objspace.std.intobject import W_IntObject
from pypy.objspace.std.listobject import W_ListObject, W_TupleObject
from pypy.objspace.std.st... | Python |
from pypy.rlib.objectmodel import we_are_translated
from pypy.interpreter.error import OperationError
from pypy.interpreter import gateway, baseobjspace
from pypy.objspace.std.listobject import W_ListObject
from pypy.module.cclp.types import W_Var, W_FailedValue, aliases
from pypy.module.cclp.misc import w, v, AppCoro... | Python |
# NOT_RPYTHON
from _structseq import structseqtype, structseqfield
error = OSError
class stat_result:
__metaclass__ = structseqtype
st_mode = structseqfield(0, "protection bits")
st_ino = structseqfield(1, "inode")
st_dev = structseqfield(2, "device")
st_nlink = structseqfield(3, "number o... | Python |
from pypy.rpython.rctypes.tool import ctypes_platform
from ctypes import *
from pypy.rpython.rctypes.tool import util # ctypes.util from 0.9.9.6
from pypy.rpython.rctypes.aerrno import geterrno
includes = ['unistd.h', 'sys/types.h']
dllname = util.find_library('c')
assert dllname is not None
libc = cdll.LoadLib... | Python |
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
from pypy.rpython.module.ll_os import w_star
#Turned off for now. posix must support targets without ctypes.
#from pypy.module.posix import ctypes_posix
import os
exec 'import %s as posix' % os.name
class Module(MixedModule):
"""This m... | Python |
from pypy.interpreter.baseobjspace import ObjSpace, W_Root
from pypy.rlib.rarithmetic import intmask
from pypy.rlib import ros
from pypy.interpreter.error import OperationError, wrap_oserror
from pypy.rpython.module.ll_os import w_star, w_star_returning_int
import os
def open(space, fname, f... | Python |
from pypy.rpython.rctypes.tool import ctypes_platform
from pypy.rpython.rctypes.tool.libc import libc
import pypy.rpython.rctypes.implementation # this defines rctypes magic
from pypy.rpython.rctypes.aerrno import geterrno
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import W_Roo... | Python |
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
interpleveldefs = {
'PAGESIZE': 'space.wrap(interp_mmap.PAGESIZE)',
'mmap': 'interp_mmap.mmap'
}
appleveldefs = {
'ACCESS_READ': 'app_mmap.ACCESS_READ',
'ACCESS_WRITE': 'app_mmap.ACCESS_WRITE',
... | Python |
ACCESS_READ = 1
ACCESS_WRITE = 2
ACCESS_COPY = 3
error = EnvironmentError
| Python |
from pypy.interpreter.nestedscope import Cell
from pypy.interpreter.pycode import PyCode
from pypy.interpreter.function import Function, Method
from pypy.interpreter.module import Module
from pypy.interpreter.pyframe import PyFrame
from pypy.interpreter.pytraceback import PyTraceback
from pypy.interpreter.generator imp... | Python |
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
"""Built-in functions, exceptions, and other objects."""
appleveldefs = {
}
interpleveldefs = {
'cell_new' : 'maker.cell_new',
'code_new' : 'maker.code_new',
'func_new' : 'maker.func_n... | Python |
"""
Plain Python definition of the builtin functions oriented towards
functional programming.
"""
from __future__ import generators
def sum(sequence, total=0):
"""sum(sequence, start=0) -> value
Returns the sum of a sequence of numbers (NOT strings) plus the value
of parameter 'start'. When the sequence is emp... | Python |
"""
Implementation of the interpreter-level compile/eval builtins.
"""
from pypy.interpreter.pycode import PyCode
from pypy.interpreter.baseobjspace import W_Root, ObjSpace
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import NoneNotWrapped
def compile(space, w_source, filename, mod... | Python |
# NOT_RPYTHON (but maybe soon)
"""
Plain Python definition of the builtin I/O-related functions.
"""
import sys
def execfile(filename, glob=None, loc=None):
"""execfile(filename[, globals[, locals]])
Read and execute a Python script from a file.
The globals and locals are dictionaries, defaulting to the current
... | Python |
"""
Implementation of the interpreter-level default import logic.
"""
import sys, os, stat
from pypy.interpreter.module import Module
from pypy.interpreter import gateway
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import W_Root, ObjSpace
from pypy.interpreter.eval import Code... | Python |
"""
Interp-level definition of frequently used functionals.
"""
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import ObjSpace, W_Root, NoneNotWrapped, applevel
from pypy.interpreter.gateway import interp2app
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.baseobjsp... | Python |
class State:
def __init__(self, space):
self.w_file = space.appexec([], """():
import _file;
return _file.file""")
def get(space):
return space.fromcache(State)
| Python |
"""
Plain Python definition of the builtin functions related to run-time
program introspection.
"""
import sys
def globals():
"Return the dictionary containing the current scope's global variables."
return sys._getframe(0).f_globals
def locals():
"""Return a dictionary containing the current scope's loca... | Python |
# NOT_RPYTHON
class file(object):
"""file(name[, mode[, buffering]]) -> file object
Open a file. The mode can be 'r', 'w' or 'a' for reading (default),
writing or appending. The file will be created if it doesn't exist
when opened for writing or appending; it will be truncated when
opened for writing. Add a '... | Python |
"""
Plain Python definition of the builtin interactive help functions.
"""
import sys
if sys.platform == "win32":
exit = "Use Ctrl-Z plus Return to exit."
else:
exit = "Use Ctrl-D (i.e. EOF) to exit."
def copyright():
print 'Copyright 2003-2007 PyPy development team.\nAll rights reserved.\nFor further in... | Python |
"""
Interp-level implementation of the basic space operations.
"""
from pypy.interpreter import gateway
from pypy.interpreter.baseobjspace import ObjSpace
from pypy.interpreter.error import OperationError
import __builtin__
NoneNotWrapped = gateway.NoneNotWrapped
def abs(space, w_val):
"abs(number) -> number\n\nR... | Python |
from pypy.interpreter.error import OperationError
from pypy.interpreter import module
from pypy.interpreter.mixedmodule import MixedModule
# put builtins here that should be optimized somehow
OPTIMIZED_BUILTINS = ["len", "range", "xrange", "min", "max", "enumerate",
"isinstance", "type", "zip", "file", "open"... | Python |
"""
Plain Python definition of the 'complex' type.
"""
#XXX Hack: This float is supposed to overflow to inf
#OVERFLOWED_FLOAT = float("1e10000000000000000000000000000000")
# but this would crash with marshal v.1.0
OVERFLOWED_FLOAT = 1e200
OVERFLOWED_FLOAT *= OVERFLOWED_FLOAT
class complex(object):
"""complex(rea... | Python |
# Might probably be deprecated in Python at some point.
import sys
class buffer(object):
"""buffer(object [, offset[, size]])
Create a new buffer object which references the given object.
The buffer will reference a slice of the target object from the
start of the object (or at the specified offset). The slice wi... | Python |
"""
Plain Python definition of some miscellaneous builtin functions.
"""
def find_module(fullname, path):
import sys
meta_path = sys.meta_path
for hook in meta_path:
loader = hook.find_module(fullname, path)
if loader:
return loader
if path != None and type(path) == str:
... | Python |
"""
Plain Python definition of the builtin descriptors.
"""
# Descriptor code, shamelessly stolen from Raymond Hettinger:
# http://users.rcn.com/python/download/Descriptor.htm
# XXX there is an interp-level pypy.interpreter.function.StaticMethod
# XXX because __new__ needs to be a StaticMethod early.
class static... | Python |
# NOT_RPYTHON
"""
This emulates CPython's set and frozenset types based on the current sets
module. Diff against the sets module to find specific changes. Here's some
pointers:
- __slots__ as well as __setstate__/__getstate__ were removed from the set
classes to support pickling in conjunction with __reduce__.
- non... | Python |
#!/usr/bin/env python
"""
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Note that this test currently runs at cpython-level and not
at any application level ....
"""
#taken from CPython 2.3 (?)
"""
Test module for class complex in complexobject.py
As it seems there are some numerical differences in
the __... | Python |
"""
self cloning, automatic path configuration
copy this into any subdirectory of pypy from which scripts need
to be run, typically all of the test subdirs.
The idea is that any such script simply issues
import autopath
and this will make sure that the parent directory containing "pypy"
is in sys.path.
If y... | Python |
from pypy.interpreter.gateway import ObjSpace
from pypy.interpreter.error import OperationError
from pypy.rlib import rgc # Force registration of gc.collect
import gc
def collect(space):
"Run a full collection."
gc.collect()
collect.unwrap_spec = [ObjSpace]
import sys
platform = sys.platform
def estimat... | Python |
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
appleveldefs = {
'enable': 'app_gc.enable',
'disable': 'app_gc.disable',
'isenabled': 'app_gc.isenabled',
}
interpleveldefs = {
'collect': 'interp_gc.collect',
'estimate_heap_size': '... | Python |
def isenabled():
"Not implemented."
def enable():
"Not implemented."
def disable():
"Not implemented."
| Python |
class sslerror(Exception):
pass
__doc__ = """Implementation module for SSL socket operations.
See the socket module for documentation."""
| Python |
from pypy.rpython.rctypes.tool import ctypes_platform
from pypy.rpython.rctypes.tool.libc import libc
import pypy.rpython.rctypes.implementation # this defines rctypes magic
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import W_Root, ObjSpace, Wrappable
from pypy.interpreter.type... | Python |
from ctypes import *
STRING = c_char_p
OSLittleEndian = 1
OSUnknownByteOrder = 0
OSBigEndian = 2
P_ALL = 0
P_PID = 1
P_PGID = 2
__darwin_nl_item = c_int
__darwin_wctrans_t = c_int
__darwin_wctype_t = c_ulong
__int8_t = c_byte
__uint8_t = c_ubyte
__int16_t = c_short
__uint16_t = c_ushort
__int32_t = c_int
__uint32_t =... | Python |
#import py # FINISHME - more thinking needed
raise ImportError
#skip("The _ssl module is only usable when running on the exact "
# "same platform from which the ssl.py was computed.")
# This module is imported by socket.py. It should *not* be used
# directly.
from pypy.interpreter.mixedmodule import ... | Python |
from ctypes import *
STRING = c_char_p
OSUnknownByteOrder = 0
UIT_PROMPT = 1
P_PGID = 2
P_PID = 1
UIT_ERROR = 5
UIT_INFO = 4
UIT_NONE = 0
P_ALL = 0
UIT_VERIFY = 2
OSBigEndian = 2
UIT_BOOLEAN = 3
OSLittleEndian = 1
__darwin_nl_item = c_int
__darwin_wctrans_t = c_int
__darwin_wctype_t = c_ulong
__int8_t = c_byte
__uint... | Python |
"""
Thread support based on OS-level threads.
"""
import thread
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import NoneNotWrapped
from pypy.interpreter.gateway import ObjSpace, W_Root, Arguments
# Force the declaration of thread.start_new_thread() & co. for RPython
import pypy.modu... | Python |
"""
Annotation support for interp-level lock objects.
"""
import thread
from pypy.rpython.extfunctable import declare, declaretype, standardexceptions
module = 'pypy.module.thread.rpython.ll_thread'
# ____________________________________________________________
# The external type thread.LockType
locktypeinfo = dec... | Python |
"""
Dummy low-level implementations for the external functions of the 'thread'
module.
"""
import thread
from pypy.rpython.lltypesystem.lltype import malloc
from pypy.rpython.module.support import init_opaque_object, from_opaque_object
from pypy.module.thread.rpython.exttable import locktypeinfo
LOCKCONTAINERTYPE = l... | Python |
#
| Python |
#
| Python |
import thread
# Force the declaration of thread.start_new_thread() & co. for RPython
import pypy.module.thread.rpython.exttable
class OSThreadLocals:
"""Thread-local storage for OS-level threads.
For memory management, this version depends on explicit notification when
a thread finishes. This works as l... | Python |
class error(Exception):
pass
def exit():
"""This is synonymous to ``raise SystemExit''. It will cause the current
thread to exit silently unless the exception is caught."""
raise SystemExit
| Python |
"""
Global Interpreter Lock.
"""
# This module adds a global lock to an object space.
# If multiple threads try to execute simultaneously in this space,
# all but one will be blocked. The other threads get a chance to run
# from time to time, using the executioncontext's XXX
import thread
from pypy.interpreter.miscu... | Python |
"""
Python locks, based on true threading locks provided by the OS.
"""
import thread
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace import Wrappable
from pypy.interpreter.gateway import ObjSpace, interp2app
from pypy.interpreter.typedef import TypeDef
# Force the declaration of ... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.