David Schneider avatar David Schneider committed eeb247a Merge

merge default

Comments (0)

Files changed (511)

 ^pypy/module/cpyext/test/.+\.obj$
 ^pypy/module/cpyext/test/.+\.manifest$
 ^pypy/module/test_lib_pypy/ctypes_tests/.+\.o$
+^pypy/module/cppyy/src/.+\.o$
+^pypy/module/cppyy/bench/.+\.so$
+^pypy/module/cppyy/bench/.+\.root$
+^pypy/module/cppyy/bench/.+\.d$
+^pypy/module/cppyy/src/.+\.errors$
+^pypy/module/cppyy/test/.+_rflx\.cpp$
+^pypy/module/cppyy/test/.+\.so$
+^pypy/module/cppyy/test/.+\.rootmap$
+^pypy/module/cppyy/test/.+\.exe$
+^pypy/module/cppyy/test/.+_cint.h$
 ^pypy/doc/.+\.html$
 ^pypy/doc/config/.+\.rst$
 ^pypy/doc/basicblock\.asc$
     DFKI GmbH, Germany 
     Impara, Germany
     Change Maker, Sweden 
+    University of California Berkeley, USA
 
 The PyPy Logo as used by http://speed.pypy.org and others was created
 by Samuel Reis and is distributed on terms of Creative Commons Share Alike

ctypes_configure/cbuild.py

         self.library_dirs = list(eci.library_dirs)
         self.compiler_exe = compiler_exe
         self.profbased = profbased
-        if not sys.platform in ('win32', 'darwin'): # xxx
+        if not sys.platform in ('win32', 'darwin', 'cygwin'): # xxx
             if 'm' not in self.libraries:
                 self.libraries.append('m')
             if 'pthread' not in self.libraries:

lib-python/2.7/ctypes/__init__.py

         self._FuncPtr = _FuncPtr
 
         if handle is None:
-            self._handle = _ffi.CDLL(name, mode)
+            if flags & _FUNCFLAG_CDECL:
+                self._handle = _ffi.CDLL(name, mode)
+            else:
+                self._handle = _ffi.WinDLL(name, mode)
         else:
             self._handle = handle
 

lib-python/2.7/distutils/sysconfig_pypy.py

     If 'prefix' is supplied, use it instead of sys.prefix or
     sys.exec_prefix -- i.e., ignore 'plat_specific'.
     """
-    if standard_lib:
-        raise DistutilsPlatformError(
-            "calls to get_python_lib(standard_lib=1) cannot succeed")
     if prefix is None:
         prefix = PREFIX
+    if standard_lib:
+        return os.path.join(prefix, "lib-python", get_python_version())
     return os.path.join(prefix, 'site-packages')
 
 

lib-python/2.7/pickle.py

             # else tmp is empty, and we're done
 
     def save_dict(self, obj):
-        modict_saver = self._pickle_moduledict(obj)
+        modict_saver = self._pickle_maybe_moduledict(obj)
         if modict_saver is not None:
             return self.save_reduce(*modict_saver)
 
                 write(SETITEM)
             # else tmp is empty, and we're done
 
-    def _pickle_moduledict(self, obj):
+    def _pickle_maybe_moduledict(self, obj):
         # save module dictionary as "getattr(module, '__dict__')"
+        try:
+            name = obj['__name__']
+            if type(name) is not str:
+                return None
+            themodule = sys.modules[name]
+            if type(themodule) is not ModuleType:
+                return None
+            if themodule.__dict__ is not obj:
+                return None
+        except (AttributeError, KeyError, TypeError):
+            return None
 
-        # build index of module dictionaries
-        try:
-            modict = self.module_dict_ids
-        except AttributeError:
-            modict = {}
-            from sys import modules
-            for mod in modules.values():
-                if isinstance(mod, ModuleType):
-                    modict[id(mod.__dict__)] = mod
-            self.module_dict_ids = modict
-
-        thisid = id(obj)
-        try:
-            themodule = modict[thisid]
-        except KeyError:
-            return None
-        from __builtin__ import getattr
         return getattr, (themodule, '__dict__')
 
 
Add a comment to this file

lib-python/2.7/test/test_bool.py

File contents unchanged.

lib-python/stdlib-upgrade.txt

+Process for upgrading the stdlib to a new cpython version
+==========================================================
+
+.. note::
+
+    overly detailed
+
+1. check out the branch vendor/stdlib
+2. upgrade the files there
+3. update stdlib-versions.txt with the output of hg -id from the cpython repo
+4. commit
+5. update to default/py3k
+6. create a integration branch for the new stdlib
+   (just hg branch stdlib-$version)
+7. merge vendor/stdlib
+8. commit
+10. fix issues
+11. commit --close-branch
+12. merge to default

lib_pypy/_ctypes/basics.py

         else:
             return self.from_param(as_parameter)
 
-    def get_ffi_param(self, value):
-        cdata = self.from_param(value)
-        return cdata, cdata._to_ffi_param()
-
     def get_ffi_argtype(self):
         if self._ffiargtype:
             return self._ffiargtype

lib_pypy/_ctypes/function.py

         address = self._get_address()
         ffiargs = [argtype.get_ffi_argtype() for argtype in argtypes]
         ffires = restype.get_ffi_argtype()
-        return _ffi.FuncPtr.fromaddr(address, '', ffiargs, ffires)
+        return _ffi.FuncPtr.fromaddr(address, '', ffiargs, ffires, self._flags_)
 
     def _getfuncptr(self, argtypes, restype, thisarg=None):
         if self._ptr is not None and (argtypes is self._argtypes_ or argtypes == self._argtypes_):
             ptr = thisarg[0][self._com_index - 0x1000]
             ffiargs = [argtype.get_ffi_argtype() for argtype in argtypes]
             ffires = restype.get_ffi_argtype()
-            return _ffi.FuncPtr.fromaddr(ptr, '', ffiargs, ffires)
+            return _ffi.FuncPtr.fromaddr(ptr, '', ffiargs, ffires, self._flags_)
         
         cdll = self.dll._handle
         try:
 
     @classmethod
     def _conv_param(cls, argtype, arg):
-        if isinstance(argtype, _CDataMeta):
-            cobj, ffiparam = argtype.get_ffi_param(arg)
-            return cobj, ffiparam, argtype
-        
         if argtype is not None:
             arg = argtype.from_param(arg)
         if hasattr(arg, '_as_parameter_'):

lib_pypy/_ctypes/primitive.py

                 self._buffer[0] = value
             result.value = property(_getvalue, _setvalue)
 
+        elif tp == '?':  # regular bool
+            def _getvalue(self):
+                return bool(self._buffer[0])
+            def _setvalue(self, value):
+                self._buffer[0] = bool(value)
+            result.value = property(_getvalue, _setvalue)
+
         elif tp == 'v': # VARIANT_BOOL type
             def _getvalue(self):
                 return bool(self._buffer[0])
Add a comment to this file

lib_pypy/_ctypes/structure.py

File contents unchanged.

lib_pypy/ctypes_support.py

 if sys.platform == 'win32':
     import _ffi
     standard_c_lib = ctypes.CDLL('msvcrt', handle=_ffi.get_libc())
+elif sys.platform == 'cygwin':
+    standard_c_lib = ctypes.CDLL(ctypes.util.find_library('cygwin'))
 else:
     standard_c_lib = ctypes.CDLL(ctypes.util.find_library('c'))
 

lib_pypy/disassembler.py

         self.lineno = lineno
         self.line_starts_here = False
 
+    def __str__(self):
+        if self.arg is None:
+            return "%s" % (self.__class__.__name__,)
+        return "%s (%s)" % (self.__class__.__name__, self.arg)
+
     def __repr__(self):
         if self.arg is None:
             return "<%s at %d>" % (self.__class__.__name__, self.pos)

pypy/annotation/annrpython.py

         self.build_graph_types(graph, inputcells, complete_now=False)
         self.complete_helpers(policy)
         return graph
-    
-    def annotate_helper_method(self, _class, attr, args_s, policy=None):
-        """ Warning! this method is meant to be used between
-        annotation and rtyping
-        """
-        if policy is None:
-            from pypy.annotation.policy import AnnotatorPolicy
-            policy = AnnotatorPolicy()
-        
-        assert attr != '__class__'
-        classdef = self.bookkeeper.getuniqueclassdef(_class)
-        attrdef = classdef.find_attribute(attr)
-        s_result = attrdef.getvalue()
-        classdef.add_source_for_attribute(attr, classdef.classdesc)
-        self.bookkeeper
-        assert isinstance(s_result, annmodel.SomePBC)
-        olddesc = s_result.any_description()
-        desc = olddesc.bind_self(classdef)
-        args = self.bookkeeper.build_args("simple_call", args_s[:])
-        desc.consider_call_site(self.bookkeeper, desc.getcallfamily(), [desc],
-            args, annmodel.s_ImpossibleValue, None)
-        result = []
-        def schedule(graph, inputcells):
-            result.append((graph, inputcells))
-            return annmodel.s_ImpossibleValue
-
-        prevpolicy = self.policy
-        self.policy = policy
-        self.bookkeeper.enter(None)
-        try:
-            desc.pycall(schedule, args, annmodel.s_ImpossibleValue)
-        finally:
-            self.bookkeeper.leave()
-            self.policy = prevpolicy
-        [(graph, inputcells)] = result
-        self.build_graph_types(graph, inputcells, complete_now=False)
-        self.complete_helpers(policy)
-        return graph
 
     def complete_helpers(self, policy):
         saved = self.policy, self.added_blocks

pypy/annotation/binaryop.py

 
     def mul((str1, int2)): # xxx do we want to support this
         getbookkeeper().count("str_mul", str1, int2)
-        return SomeString()
+        return SomeString(no_nul=str1.no_nul)
 
 class __extend__(pairtype(SomeUnicodeString, SomeInteger)):
     def getitem((str1, int2)):

pypy/annotation/bookkeeper.py

                 try:
                     assert pyobj._freeze_()
                 except AttributeError:
-                    raise Exception("unexpected prebuilt constant: %r" % (
-                        pyobj,))
+                    if hasattr(pyobj, '__call__'):
+                        msg = "object with a __call__ is not RPython"
+                    else:
+                        msg = "unexpected prebuilt constant"
+                    raise Exception("%s: %r" % (msg, pyobj))
                 result = self.getfrozen(pyobj)
             self.descs[pyobj] = result
             return result

pypy/annotation/description.py

                     continue
                 self.add_source_attribute(name, value, mixin=True)
 
-    def add_sources_for_class(self, cls, mixin=False):
+    def add_sources_for_class(self, cls):
         for name, value in cls.__dict__.items():
-            self.add_source_attribute(name, value, mixin)
+            self.add_source_attribute(name, value)
 
     def getallclassdefs(self):
         return self._classdefs.values()

pypy/annotation/test/test_annrpython.py

         assert isinstance(s, annmodel.SomeString)
         assert s.no_nul
 
+    def test_mul_str0(self):
+        def f(s):
+            return s*10
+        a = self.RPythonAnnotator()
+        s = a.build_types(f, [annmodel.SomeString(no_nul=True)])
+        assert isinstance(s, annmodel.SomeString)
+        assert s.no_nul
+        
+
     def test_non_none_and_none_with_isinstance(self):
         class A(object):
             pass
         s = a.build_types(f, [])
         assert s.knowntype == int
 
-    def test_helper_method_annotator(self):
-        def fun():
-            return 21
-
-        class A(object):
-            def helper(self):
-                return 42
-
-        a = self.RPythonAnnotator()
-        a.build_types(fun, [])
-        a.annotate_helper_method(A, "helper", [])
-        assert a.bookkeeper.getdesc(A.helper).getuniquegraph()
-        assert a.bookkeeper.getdesc(A().helper).getuniquegraph()
-
     def test_chr_out_of_bounds(self):
         def g(n, max):
             if n < max:
         assert isinstance(s, annmodel.SomeString)
         assert not s.can_be_None
 
+    def test_no___call__(self):
+        class X(object):
+            def __call__(self):
+                xxx
+        x = X()
+        def f():
+            return x
+        a = self.RPythonAnnotator()
+        e = py.test.raises(Exception, a.build_types, f, [])
+        assert 'object with a __call__ is not RPython' in str(e.value)
+
+    def test_os_getcwd(self):
+        import os
+        def fn():
+            return os.getcwd()
+        a = self.RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeString)
+        assert s.no_nul
+
+    def test_os_getenv(self):
+        import os
+        def fn():
+            return os.environ.get('PATH')
+        a = self.RPythonAnnotator()
+        s = a.build_types(fn, [])
+        assert isinstance(s, annmodel.SomeString)
+        assert s.no_nul
+
+
+
 def g(n):
     return [0,1,2,n]
 
     space.setitem(space.sys.w_dict, space.wrap('executable'),
                   space.wrap(argv[0]))
 
-    # call pypy_initial_path: the side-effect is that it sets sys.prefix and
+    # call pypy_find_stdlib: the side-effect is that it sets sys.prefix and
     # sys.exec_prefix
-    srcdir = os.path.dirname(os.path.dirname(pypy.__file__))
-    space.appexec([space.wrap(srcdir)], """(srcdir):
+    executable = argv[0]
+    space.appexec([space.wrap(executable)], """(executable):
         import sys
-        sys.pypy_initial_path(srcdir)
+        sys.pypy_find_stdlib(executable)
     """)
 
     # set warning control options (if any)

pypy/config/pypyoption.py

 module_dependencies = {
     '_multiprocessing': [('objspace.usemodules.rctime', True),
                          ('objspace.usemodules.thread', True)],
+    'cpyext': [('objspace.usemodules.array', True)],
     }
 module_suggests = {
     # the reason you want _rawffi is for ctypes, which
Add a comment to this file

pypy/config/translationoption.py

File contents unchanged.

File contents unchanged.

pypy/doc/coding-guide.rst

     >>>> cPickle.__file__
     '/home/hpk/pypy-dist/lib_pypy/cPickle..py'
 
-    >>>> import opcode
-    >>>> opcode.__file__
-    '/home/hpk/pypy-dist/lib-python/modified-2.7/opcode.py'
-
     >>>> import os
     >>>> os.__file__
     '/home/hpk/pypy-dist/lib-python/2.7/os.py'
 
     contains pure Python reimplementation of modules.
 
-*lib-python/modified-2.7/*
-
-    The files and tests that we have modified from the CPython library.
-
 *lib-python/2.7/*
 
-    The unmodified CPython library. **Never ever check anything in there**.
+    The modified CPython library.
 
 .. _`modify modules`:
 
 by default and CPython has a number of places where it relies
 on some classes being old-style.
 
-If you want to change a module or test contained in ``lib-python/2.7``
-then make sure that you copy the file to our ``lib-python/modified-2.7``
-directory first.  In mercurial commandline terms this reads::
-
-    $ hg cp lib-python/2.7/somemodule.py lib-python/modified-2.7/
-
-and subsequently you edit and commit
-``lib-python/modified-2.7/somemodule.py``.  This copying operation is
-important because it keeps the original CPython tree clean and makes it
-obvious what we had to change.
+We just maintain those changes in place,
+to see what is changed we have a branch called `vendot/stdlib`
+wich contains the unmodified cpython stdlib
 
 .. _`mixed module mechanism`:
 .. _`mixed modules`:
 # built documents.
 #
 # The short X.Y version.
-version = '1.8'
+version = '1.9'
 # The full version, including alpha/beta/rc tags.
-release = '1.8'
+release = '1.9'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
Add a comment to this file

pypy/doc/config/commandline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.allworkingmodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.disable_call_speedhacks.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.geninterp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.honor__builtins__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.logbytecodes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.lonepycfiles.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.name.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.nofaking.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.opcodes.CALL_METHOD.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.opcodes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.soabi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.builtinshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.getattributeshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.logspaceoptypes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.methodcachesizeexp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.multimethods.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.mutable_builtintypes.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.newshortcut.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_comparison_op.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_int_add.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.optimized_list_getitem.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.prebuiltintfrom.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.prebuiltintto.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.sharesmallstr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withcelldict.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmapdict.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmethodcache.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withmethodcachecounter.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withprebuiltchar.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withprebuiltint.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withrangelist.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withrope.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withropeunicode.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withsmallint.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrbuf.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrjoin.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withstrslice.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withtproxy.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.std.withtypeversion.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.timing.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.translationmodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.__builtin__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.__pypy__.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ast.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._bisect.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._codecs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._continuation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._demo.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._file.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._locale.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._lsprof.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._minimal_curses.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._pickle_support.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._random.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._rawffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._socket.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._sre.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._ssl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._testing.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._weakref.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules._winreg.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.array.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.binascii.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.bz2.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.cStringIO.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.clr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.cpyext.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.crypt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.errno.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.exceptions.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.fcntl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.gc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.imp.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.itertools.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.marshal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.math.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.micronumpy.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.mmap.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.operator.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.oracle.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.parser.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.posix.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.pyexpat.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.pypyjit.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.rbench.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.rctime.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.select.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.signal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.struct.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.symbol.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.sys.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.termios.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.time.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.token.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.unicodedata.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.zipimport.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usemodules.zlib.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/objspace.usepycfiles.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backend.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.clever_malloc_removal_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.constfold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.inline_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.mallocs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.merge_if_blocks.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.none.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.print_statistics.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline_heuristic.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.profile_based_inline_threshold.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.raisingop2direct_call.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.really_remove_asserts.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.remove_asserts.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.stack_optimization.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.storesink.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.backendopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.builtins_can_raise_exceptions.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.exception_transformer.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.trace_calls.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.cli.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.compilerflags.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.continuation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.countmallocs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.debug.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.dump_static_data_info.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.fork_before.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gc.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gcremovetypeptr.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gcrootfinder.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.gctransformer.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.insist.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.instrument.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.instrumentctl.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_backend.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_ffi.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.jit_profiler.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.linkerflags.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.list_comprehension_operations.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.log.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.make_jobs.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.no__thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.noprofopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.ootype.mangle.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.ootype.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.output.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.platform.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.profopt.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.rweakref.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.sandbox.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.secondaryentrypoints.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.shared.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.simplifying.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.taggedpointers.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.thread.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.type_system.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.vanilla.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.verbose.txt

File contents unchanged.

Add a comment to this file

pypy/doc/config/translation.withsmallfuncsets.txt

File contents unchanged.

pypy/doc/cppyy.rst

 The cppyy module provides C++ bindings for PyPy by using the reflection
 information extracted from C++ header files by means of the
 `Reflex package`_.
-For this to work, you have to both install Reflex and build PyPy from the
-reflex-support branch.
+For this to work, you have to both install Reflex and build PyPy from source,
+as the cppyy module is not enabled by default.
+Note that the development version of cppyy lives in the reflex-support
+branch.
 As indicated by this being a branch, support for Reflex is still
 experimental.
 However, it is functional enough to put it in the hands of those who want
 .. _`recent snapshot`: http://cern.ch/wlav/reflex-2012-05-02.tar.bz2
 .. _`gccxml`: http://www.gccxml.org
 
-Next, get the `PyPy sources`_, select the reflex-support branch, and build
-pypy-c.
+Next, get the `PyPy sources`_, optionally select the reflex-support branch,
+and build it.
 For the build to succeed, the ``$ROOTSYS`` environment variable must point to
-the location of your ROOT (or standalone Reflex) installation::
+the location of your ROOT (or standalone Reflex) installation, or the
+``root-config`` utility must be accessible through ``PATH`` (e.g. by adding
+``$ROOTSYS/bin`` to ``PATH``).
+In case of the former, include files are expected under ``$ROOTSYS/include``
+and libraries under ``$ROOTSYS/lib``.
+Then run the translation to build ``pypy-c``::
 
     $ hg clone https://bitbucket.org/pypy/pypy
     $ cd pypy
-    $ hg up reflex-support
+    $ hg up reflex-support         # optional
     $ cd pypy/translator/goal
+    
+    # This example shows python, but using pypy-c is faster and uses less memory
     $ python translate.py -O jit --gcrootfinder=shadowstack targetpypystandalone.py --withmod-cppyy
 
 This will build a ``pypy-c`` that includes the cppyy module, and through that,
 Reflex support.
 Of course, if you already have a pre-built version of the ``pypy`` interpreter,
 you can use that for the translation rather than ``python``.
+If not, you may want `to obtain a binary distribution`_ to speed up the
+translation step.
 
 .. _`PyPy sources`: https://bitbucket.org/pypy/pypy/overview
+.. _`to obtain a binary distribution`: http://doc.pypy.org/en/latest/getting-started.html#download-a-pre-built-pypy
 
 
 Basic example
 code::
 
     $ genreflex MyClass.h
-    $ g++ -fPIC -rdynamic -O2 -shared -I$ROOTSYS/include MyClass_rflx.cpp -o libMyClassDict.so
+    $ g++ -fPIC -rdynamic -O2 -shared -I$ROOTSYS/include MyClass_rflx.cpp -o libMyClassDict.so -L$ROOTSYS/lib -lReflex
 
 Now you're ready to use the bindings.
 Since the bindings are designed to look pythonistic, it should be
 That's all there is to it!
 
 
+Automatic class loader
+======================
+There is one big problem in the code above, that prevents its use in a (large
+scale) production setting: the explicit loading of the reflection library.
+Clearly, if explicit load statements such as these show up in code downstream
+from the ``MyClass`` package, then that prevents the ``MyClass`` author from
+repackaging or even simply renaming the dictionary library.
+
+The solution is to make use of an automatic class loader, so that downstream
+code never has to call ``load_reflection_info()`` directly.
+The class loader makes use of so-called rootmap files, which ``genreflex``
+can produce.
+These files contain the list of available C++ classes and specify the library
+that needs to be loaded for their use.
+By convention, the rootmap files should be located next to the reflection info
+libraries, so that they can be found through the normal shared library search
+path.
+They can be concatenated together, or consist of a single rootmap file per
+library.
+For example::
+
+    $ genreflex MyClass.h --rootmap=libMyClassDict.rootmap --rootmap-lib=libMyClassDict.so
+    $ g++ -fPIC -rdynamic -O2 -shared -I$ROOTSYS/include MyClass_rflx.cpp -o libMyClassDict.so -L$ROOTSYS/lib -lReflex
+
+where the first option (``--rootmap``) specifies the output file name, and the
+second option (``--rootmap-lib``) the name of the reflection library where
+``MyClass`` will live.
+It is necessary to provide that name explicitly, since it is only in the
+separate linking step where this name is fixed.
+If the second option is not given, the library is assumed to be libMyClass.so,
+a name that is derived from the name of the header file.
+
+With the rootmap file in place, the above example can be rerun without explicit
+loading of the reflection info library::
+
+    $ pypy-c
+    >>>> import cppyy
+    >>>> myinst = cppyy.gbl.MyClass(42)
+    >>>> print myinst.GetMyInt()