[pypy-commit] pypy py3k: merge default

pjenvey noreply at buildbot.pypy.org
Thu Feb 28 19:32:11 CET 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r61878:f42187637524
Date: 2013-02-28 10:31 -0800
http://bitbucket.org/pypy/pypy/changeset/f42187637524/

Log:	merge default

diff too long, truncating to 2000 out of 8850 lines

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -35,39 +35,43 @@
 ^pypy/doc/config/.+\.rst$
 ^pypy/doc/basicblock\.asc$
 ^pypy/doc/.+\.svninfo$
-^pypy/translator/c/src/libffi_msvc/.+\.obj$
-^pypy/translator/c/src/libffi_msvc/.+\.dll$
-^pypy/translator/c/src/libffi_msvc/.+\.lib$
-^pypy/translator/c/src/libffi_msvc/.+\.exp$
-^pypy/translator/c/src/cjkcodecs/.+\.o$
-^pypy/translator/c/src/cjkcodecs/.+\.obj$
-^pypy/translator/jvm/\.project$
-^pypy/translator/jvm/\.classpath$
-^pypy/translator/jvm/eclipse-bin$
-^pypy/translator/jvm/src/pypy/.+\.class$
-^pypy/translator/benchmark/docutils$
-^pypy/translator/benchmark/templess$
-^pypy/translator/benchmark/gadfly$
-^pypy/translator/benchmark/mako$
-^pypy/translator/benchmark/bench-custom\.benchmark_result$
-^pypy/translator/benchmark/shootout_benchmarks$
-^pypy/translator/goal/pypy-translation-snapshot$
-^pypy/translator/goal/pypy-c
-^pypy/translator/goal/pypy-jvm
-^pypy/translator/goal/pypy-jvm.jar
-^pypy/translator/goal/.+\.exe$
-^pypy/translator/goal/.+\.dll$
-^pypy/translator/goal/target.+-c$
+^rpython/translator/c/src/libffi_msvc/.+\.obj$
+^rpython/translator/c/src/libffi_msvc/.+\.dll$
+^rpython/translator/c/src/libffi_msvc/.+\.lib$
+^rpython/translator/c/src/libffi_msvc/.+\.exp$
+^rpython/translator/c/src/cjkcodecs/.+\.o$
+^rpython/translator/c/src/cjkcodecs/.+\.obj$
+^rpython/translator/c/src/stacklet/.+\.o$
+^rpython/translator/c/src/.+\.o$
+^rpython/translator/jvm/\.project$
+^rpython/translator/jvm/\.classpath$
+^rpython/translator/jvm/eclipse-bin$
+^rpython/translator/jvm/src/pypy/.+\.class$
+^rpython/translator/benchmark/docutils$
+^rpython/translator/benchmark/templess$
+^rpython/translator/benchmark/gadfly$
+^rpython/translator/benchmark/mako$
+^rpython/translator/benchmark/bench-custom\.benchmark_result$
+^rpython/translator/benchmark/shootout_benchmarks$
+^rpython/translator/goal/target.+-c$
+^rpython/translator/goal/.+\.exe$
+^rpython/translator/goal/.+\.dll$
+^pypy/goal/pypy-translation-snapshot$
+^pypy/goal/pypy-c
+^pypy/goal/pypy-jvm
+^pypy/goal/pypy-jvm.jar
+^pypy/goal/.+\.exe$
+^pypy/goal/.+\.dll$
 ^pypy/_cache$
 ^pypy/doc/statistic/.+\.html$
 ^pypy/doc/statistic/.+\.eps$
 ^pypy/doc/statistic/.+\.pdf$
-^pypy/translator/cli/src/pypylib\.dll$
-^pypy/translator/cli/src/query\.exe$
-^pypy/translator/cli/src/main\.exe$
+^rpython/translator/cli/src/pypylib\.dll$
+^rpython/translator/cli/src/query\.exe$
+^rpython/translator/cli/src/main\.exe$
 ^lib_pypy/ctypes_config_cache/_.+_cache\.py$
 ^lib_pypy/ctypes_config_cache/_.+_.+_\.py$
-^pypy/translator/cli/query-descriptions$
+^rpython/translator/cli/query-descriptions$
 ^pypy/doc/discussion/.+\.html$
 ^include/.+\.h$
 ^include/.+\.inl$
diff --git a/lib_pypy/numpypy/core/__init__.py b/lib_pypy/numpypy/core/__init__.py
--- a/lib_pypy/numpypy/core/__init__.py
+++ b/lib_pypy/numpypy/core/__init__.py
@@ -1,18 +1,14 @@
-import _numpypy
-from _numpypy import *
 import numeric
 from numeric import *
 import fromnumeric
 from fromnumeric import *
 import shape_base
 from shape_base import *
-import multiarray
 
 from fromnumeric import amax as max, amin as min
-from _numpypy import absolute as abs
+from numeric import absolute as abs
 
 __all__ = []
-__all__ += _numpypy.__all__
 __all__ += numeric.__all__
 __all__ += fromnumeric.__all__
 __all__ += shape_base.__all__
diff --git a/lib_pypy/numpypy/core/_methods.py b/lib_pypy/numpypy/core/_methods.py
--- a/lib_pypy/numpypy/core/_methods.py
+++ b/lib_pypy/numpypy/core/_methods.py
@@ -1,11 +1,9 @@
 # Array methods which are called by the both the C-code for the method
 # and the Python code for the NumPy-namespace function
 
-#from numpy.core import multiarray as mu
-#from numpy.core import umath as um
-import _numpypy as mu
-um = mu
-from numpy.core.numeric import asanyarray
+import multiarray as mu
+import umath as um
+from numeric import asanyarray
 
 def _amax(a, axis=None, out=None, keepdims=False):
     return um.maximum.reduce(a, axis=axis,
diff --git a/lib_pypy/numpypy/core/arrayprint.py b/lib_pypy/numpypy/core/arrayprint.py
--- a/lib_pypy/numpypy/core/arrayprint.py
+++ b/lib_pypy/numpypy/core/arrayprint.py
@@ -13,9 +13,9 @@
 # and by Travis Oliphant  2005-8-22 for numpy
 
 import sys
-import _numpypy as _nt
-from _numpypy import maximum, minimum, absolute, not_equal, isnan, isinf
-#from _numpypy import format_longfloat, datetime_as_string, datetime_data
+import numerictypes as _nt
+from umath import maximum, minimum, absolute, not_equal, isnan, isinf
+#from multiarray import format_longfloat, datetime_as_string, datetime_data
 from fromnumeric import ravel
 
 
@@ -294,12 +294,12 @@
             #else:
             format_function = formatdict['int']
         elif issubclass(dtypeobj, _nt.floating):
-            if issubclass(dtypeobj, _nt.longfloat):
+            if hasattr(_nt, 'longfloat') and issubclass(dtypeobj, _nt.longfloat):
                 format_function = formatdict['longfloat']
             else:
                 format_function = formatdict['float']
         elif issubclass(dtypeobj, _nt.complexfloating):
-            if issubclass(dtypeobj, _nt.clongfloat):
+            if hasattr(_nt, 'clongfloat') and issubclass(dtypeobj, _nt.clongfloat):
                 format_function = formatdict['longcomplexfloat']
             else:
                 format_function = formatdict['complexfloat']
diff --git a/lib_pypy/numpypy/core/fromnumeric.py b/lib_pypy/numpypy/core/fromnumeric.py
--- a/lib_pypy/numpypy/core/fromnumeric.py
+++ b/lib_pypy/numpypy/core/fromnumeric.py
@@ -16,6 +16,7 @@
 ######################################################################
 
 import numpypy
+import _numpypy
 
 # Module containing non-deprecated functions borrowed from Numeric.
 __docformat__ = "restructuredtext en"
@@ -274,7 +275,7 @@
             [-1, -2, -3, -4, -5]]])
 
     """
-    raise NotImplementedError('Waiting on interp level method')
+    return _numpypy.choose(a, choices, out, mode)
 
 
 def repeat(a, repeats, axis=None):
@@ -316,7 +317,7 @@
            [3, 4]])
 
     """
-    raise NotImplementedError('Waiting on interp level method')
+    return _numpypy.repeat(a, repeats, axis)
 
 
 def put(a, ind, v, mode='raise'):
diff --git a/lib_pypy/numpypy/core/multiarray.py b/lib_pypy/numpypy/core/multiarray.py
--- a/lib_pypy/numpypy/core/multiarray.py
+++ b/lib_pypy/numpypy/core/multiarray.py
@@ -1,1 +1,1 @@
-from _numpypy import set_string_function, typeinfo
+from _numpypy.multiarray import *
diff --git a/lib_pypy/numpypy/core/numeric.py b/lib_pypy/numpypy/core/numeric.py
--- a/lib_pypy/numpypy/core/numeric.py
+++ b/lib_pypy/numpypy/core/numeric.py
@@ -1,16 +1,40 @@
-__all__ = ['asanyarray', 'base_repr',
+__all__ = [
+           'newaxis', 'ufunc',
+           'asarray', 'asanyarray', 'base_repr',
            'array_repr', 'array_str', 'set_string_function',
-           'array_equal', 'asarray', 'outer', 'identity']
+           'array_equal', 'outer', 'identity', 'little_endian',
+           'Inf', 'inf', 'infty', 'Infinity', 'nan', 'NaN', 'False_', 'True_',
+          ]
 
-from _numpypy import array, ndarray, int_, float_, bool_, flexible #, complex_# , longlong
-from _numpypy import concatenate
-from .fromnumeric import any
-import math
 import sys
 import multiarray
-from numpypy.core.arrayprint import array2string
+from multiarray import *
+del set_string_function
+del typeinfo
+import umath
+from umath import *
+import numerictypes
+from numerictypes import *
+
+def extend_all(module):
+    adict = {}
+    for a in __all__:
+        adict[a] = 1
+    try:
+        mall = getattr(module, '__all__')
+    except AttributeError:
+        mall = [k for k in module.__dict__.keys() if not k.startswith('_')]
+    for a in mall:
+        if a not in adict:
+            __all__.append(a)
+
+extend_all(multiarray)
+__all__.remove('typeinfo')
+extend_all(umath)
+extend_all(numerictypes)
 
 newaxis = None
+ufunc = type(sin)
 
 # XXX this file to be reviewed
 def seterr(**args):
@@ -121,6 +145,10 @@
         res.append('-')
     return ''.join(reversed(res or '0'))
 
+
+#Use numarray's printing function
+from arrayprint import array2string
+
 _typelessdata = [int_, float_]#, complex_]
 # XXX
 #if issubclass(intc, int):
@@ -306,6 +334,11 @@
     else:
         return multiarray.set_string_function(f, repr)
 
+set_string_function(array_str, 0)
+set_string_function(array_repr, 1)
+
+little_endian = (sys.byteorder == 'little')
+
 def array_equal(a1, a2):
     """
     True if two arrays have the same shape and elements, False otherwise.
@@ -417,21 +450,6 @@
     """
     return array(a, dtype, copy=False, order=order)
 
-set_string_function(array_str, 0)
-set_string_function(array_repr, 1)
-
-little_endian = (sys.byteorder == 'little')
-
-Inf = inf = infty = Infinity = PINF = float('inf')
-NINF = float('-inf')
-PZERO = 0.0
-NZERO = -0.0
-nan = NaN = NAN = float('nan')
-False_ = bool_(False)
-True_ = bool_(True)
-e = math.e
-pi = math.pi
-
 def outer(a,b):
     """
     Compute the outer product of two vectors.
@@ -535,3 +553,12 @@
     """
     from numpy import eye
     return eye(n, dtype=dtype)
+
+Inf = inf = infty = Infinity = PINF
+nan = NaN = NAN
+False_ = bool_(False)
+True_ = bool_(True)
+
+import fromnumeric
+from fromnumeric import *
+extend_all(fromnumeric)
diff --git a/lib_pypy/numpypy/core/numerictypes.py b/lib_pypy/numpypy/core/numerictypes.py
new file mode 100644
--- /dev/null
+++ b/lib_pypy/numpypy/core/numerictypes.py
@@ -0,0 +1,1 @@
+from _numpypy.numerictypes import *
diff --git a/lib_pypy/numpypy/core/shape_base.py b/lib_pypy/numpypy/core/shape_base.py
--- a/lib_pypy/numpypy/core/shape_base.py
+++ b/lib_pypy/numpypy/core/shape_base.py
@@ -1,6 +1,6 @@
 __all__ = ['atleast_1d', 'atleast_2d', 'atleast_3d', 'vstack', 'hstack']
 
-import _numpypy
+import numeric as _nx
 from numeric import array, asanyarray, newaxis
 
 def atleast_1d(*arys):
@@ -223,7 +223,7 @@
            [4]])
 
     """
-    return _numpypy.concatenate(map(atleast_2d,tup),0)
+    return _nx.concatenate(map(atleast_2d,tup),0)
 
 def hstack(tup):
     """
@@ -270,6 +270,6 @@
     arrs = map(atleast_1d,tup)
     # As a special case, dimension 0 of 1-dimensional arrays is "horizontal"
     if arrs[0].ndim == 1:
-        return _numpypy.concatenate(arrs, 0)
+        return _nx.concatenate(arrs, 0)
     else:
-        return _numpypy.concatenate(arrs, 1)
+        return _nx.concatenate(arrs, 1)
diff --git a/lib_pypy/numpypy/core/umath.py b/lib_pypy/numpypy/core/umath.py
new file mode 100644
--- /dev/null
+++ b/lib_pypy/numpypy/core/umath.py
@@ -0,0 +1,12 @@
+from _numpypy.umath import *
+
+import math
+e = math.e
+pi = math.pi
+del math
+
+PZERO = 0.0
+NZERO = -0.0
+PINF = float('inf')
+NINF = float('-inf')
+NAN = float('nan')
diff --git a/lib_pypy/numpypy/lib/function_base.py b/lib_pypy/numpypy/lib/function_base.py
--- a/lib_pypy/numpypy/lib/function_base.py
+++ b/lib_pypy/numpypy/lib/function_base.py
@@ -1,6 +1,6 @@
 __all__ = ['average']
 
-from _numpypy import array
+from ..core.numeric import array
 
 def average(a):
     # This implements a weighted average, for now we don't implement the
diff --git a/lib_pypy/numpypy/lib/shape_base.py b/lib_pypy/numpypy/lib/shape_base.py
--- a/lib_pypy/numpypy/lib/shape_base.py
+++ b/lib_pypy/numpypy/lib/shape_base.py
@@ -1,7 +1,7 @@
 __all__ = ['dstack']
 
-import numpypy.core.numeric as _nx
-from numpypy.core import atleast_3d
+from ..core import numeric as _nx
+from ..core import atleast_3d
 
 def dstack(tup):
     """
diff --git a/lib_pypy/numpypy/lib/twodim_base.py b/lib_pypy/numpypy/lib/twodim_base.py
--- a/lib_pypy/numpypy/lib/twodim_base.py
+++ b/lib_pypy/numpypy/lib/twodim_base.py
@@ -1,6 +1,6 @@
 __all__ = ['eye']
 
-from _numpypy import zeros
+from ..core.numeric import zeros
 
 def eye(N, M=None, k=0, dtype=float):
     """
diff --git a/pypy/doc/cpython_differences.rst b/pypy/doc/cpython_differences.rst
--- a/pypy/doc/cpython_differences.rst
+++ b/pypy/doc/cpython_differences.rst
@@ -134,7 +134,7 @@
 ``ReferenceError`` at any place that uses them.  (Or, better yet, don't use
 ``weakref.proxy()`` at all; use ``weakref.ref()``.)
 
-There are a few extra implications for the difference in the GC.  Most
+There are a few extra implications from the difference in the GC.  Most
 notably, if an object has a ``__del__``, the ``__del__`` is never called more
 than once in PyPy; but CPython will call the same ``__del__`` several times
 if the object is resurrected and dies again.  The ``__del__`` methods are
@@ -156,7 +156,7 @@
 
 .. __: http://bugs.pypy.org/issue736
 
-Using the default GC called ``minimark``, the built-in function ``id()``
+Using the default GC (called ``minimark``), the built-in function ``id()``
 works like it does in CPython.  With other GCs it returns numbers that
 are not real addresses (because an object can move around several times)
 and calling it a lot can lead to performance problem.
@@ -286,7 +286,7 @@
 -------------
 
 * Hash randomization (``-R``) is ignored in PyPy.  As documented in
-  http://bugs.python.org/issue14621 , some of us believe it has no
+  http://bugs.python.org/issue14621, some of us believe it has no
   purpose in CPython either.
 
 * ``sys.setrecursionlimit(n)`` sets the limit only approximately,
diff --git a/pypy/doc/faq.rst b/pypy/doc/faq.rst
--- a/pypy/doc/faq.rst
+++ b/pypy/doc/faq.rst
@@ -202,20 +202,20 @@
 Be sure to enable it again if you need it!
 
 
-The PyPy translation tool chain
-===============================
+The RPython translation tool chain
+===================================
 
----------------------------------------------
-Can PyPy compile normal Python programs to C?
----------------------------------------------
+------------------------------------------------
+Can RPython compile normal Python programs to C?
+------------------------------------------------
 
-No, PyPy is not a Python compiler.
+No, RPython is not a Python compiler.
 
 In Python, it is mostly impossible to *prove* anything about the types
 that a program will manipulate by doing a static analysis.  It should be
 clear if you are familiar with Python, but if in doubt see [BRETT]_.
 
-If you want a fast Python program, please use our JIT_ instead.
+If you want a fast Python program, please use the PyPy JIT_ instead.
 
 .. _JIT: jit/index.html
 
@@ -300,8 +300,8 @@
 Do I have to rewrite my programs in RPython?
 --------------------------------------------
 
-No.  And you shouldn't try.  First and foremost, RPython is a language
-that is designed to write interpreters in.  It is a restricted subset of
+No, and you shouldn't try.  First and foremost, RPython is a language
+designed for writing interpreters. It is a restricted subset of
 Python.  If you program is not an interpreter but tries to do "real
 things", like use *any* part of the standard Python library or *any*
 3rd-party library, then it is not RPython to start with.  You should
@@ -381,8 +381,8 @@
 
 No, you have to rebuild the entire interpreter.  This means two things:
 
-* It is imperative to use test-driven development.  You have to test
-  exhaustively your module in pure Python, before even attempting to
+* It is imperative to use test-driven development.  You have to exhaustively
+  test your module in pure Python, before even attempting to
   translate it.  Once you translate it, you should have only a few typing
   issues left to fix, but otherwise the result should work out of the box.
 
diff --git a/pypy/doc/getting-started-dev.rst b/pypy/doc/getting-started-dev.rst
--- a/pypy/doc/getting-started-dev.rst
+++ b/pypy/doc/getting-started-dev.rst
@@ -20,7 +20,7 @@
 
 To start the interactive translator shell do::
 
-    cd pypy
+    cd rpython
     python bin/translatorshell.py
 
 Test snippets of translatable code are provided in the file
diff --git a/pypy/doc/interpreter.rst b/pypy/doc/interpreter.rst
--- a/pypy/doc/interpreter.rst
+++ b/pypy/doc/interpreter.rst
@@ -25,7 +25,7 @@
 compact bytecode format as CPython 2.7, with minor differences in the bytecode
 set.  Our bytecode compiler is
 implemented as a chain of flexible passes (tokenizer, lexer, parser,
-abstract syntax tree builder, bytecode generator).  The latter passes
+abstract syntax tree builder and bytecode generator).  The latter passes
 are based on the ``compiler`` package from the standard library of
 CPython, with various improvements and bug fixes. The bytecode compiler
 (living under `pypy/interpreter/astcompiler/`_) is now integrated and is
@@ -38,8 +38,8 @@
 calling its ``frame.eval()`` method.  This main entry point 
 initialize appropriate namespaces and then interprets each 
 bytecode instruction.  Python's standard library contains
-the `lib-python/2.7/dis.py`_ module which allows to view
-the Virtual's machine bytecode instructions:: 
+the `lib-python/2.7/dis.py`_ module which allows to inspection 
+of the virtual machine's bytecode instructions:: 
 
     >>> import dis
     >>> def f(x):
@@ -50,10 +50,10 @@
               6 BINARY_ADD          
               7 RETURN_VALUE        
 
-CPython as well as PyPy are stack-based virtual machines, i.e.
-they don't have registers but put object to and pull objects
+CPython and PyPy are stack-based virtual machines, i.e.
+they don't have registers but instead push object to and pull objects
 from a stack.  The bytecode interpreter is only responsible
-for implementing control flow and putting and pulling black
+for implementing control flow and pushing and pulling black
 box objects to and from this value stack.  The bytecode interpreter 
 does not know how to perform operations on those black box
 (`wrapped`_) objects for which it delegates to the `object
@@ -75,8 +75,8 @@
 on ``OperationErrors``. 
 
 The interpreter implementation offers mechanisms to allow a
-caller to be unaware if a particular function invocation leads
-to bytecode interpretation or is executed directly at
+caller to be unaware of whether a particular function invocation 
+leads to bytecode interpretation or is executed directly at
 interpreter-level.  The two basic kinds of `Gateway classes`_
 expose either an interpreter-level function to
 application-level execution (``interp2app``) or allow
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -18,6 +18,9 @@
 
 .. branch: numpypy-longdouble
 Long double support for numpypy
+.. branch: numpypy-disable-longdouble
+Since r_longdouble support is missing, disable all longdouble and derivative
+dtypes using ENABLED_LONG_DOUBLE = False
 .. branch: numpypy-real-as-view
 Convert real, imag from ufuncs to views. This involves the beginning of
 view() functionality
@@ -36,6 +39,7 @@
 .. branch: task-decorator
 .. branch: fix-e4fa0b2
 .. branch: win32-fixes
+.. branch: numpy-unify-methods
 .. branch: fix-version-tool
 .. branch: popen2-removal
 
@@ -72,3 +76,9 @@
 
 .. branch: enumerate-rstr
 Support enumerate() over rstr types.
+
+.. branch: cleanup-numpypy-namespace
+Cleanup _numpypy and numpypy namespaces to more closely resemble numpy.
+
+.. branch: kill-flowobjspace
+Random cleanups to hide FlowObjSpace from public view.
diff --git a/pypy/goal/multibuild.py b/pypy/goal/multibuild.py
deleted file mode 100644
--- a/pypy/goal/multibuild.py
+++ /dev/null
@@ -1,127 +0,0 @@
-from pypy.config.pypyoption import get_pypy_config
-from rpython.translator.goal import translate
-from rpython.translator.goal import targetpypystandalone
-from rpython.translator.driver import TranslationDriver
-import os, sys, traceback, random
-
-def longoptfromname(config, name):
-    from pypy.config.makerestdoc import get_cmdline
-    # begin horror
-    h, n = config._cfgimpl_get_home_by_path(name)
-    opt = getattr(h._cfgimpl_descr, n)
-    # end horror
-    cmdline = get_cmdline(opt.cmdline, name)
-    assert cmdline is not None
-    shortest_long_option = 'X'*1000
-    for cmd in cmdline.split():
-        if cmd.startswith('--') and len(cmd) < len(shortest_long_option):
-            shortest_long_option = cmd
-    return shortest_long_option
-
-def exe_name_from_options(config, opts):
-    from pypy.module.sys.version import svn_revision
-
-    backend = config.translation.backend
-    if not backend:
-        backend = 'c'
-    rev = svn_revision()
-
-    nameparts = []
-
-    for opt, v in opts.iteritems():
-        if opt == 'translation.backend':
-            backend = v
-        optname = longoptfromname(config, opt).strip('-')
-        if v is False:
-            optname = 'no-' + optname
-        elif v is not True:
-            optname += '=' + str(v)
-        nameparts.append(optname)
-
-    suffix = ''
-    if nameparts:
-        def k(s):
-            if s.startswith('no-'):
-                return s[3:]
-            else:
-                return s
-        nameparts.sort(key=k)
-        suffix = '-' + '-'.join(nameparts)
-
-    return 'pypy-%s-%d%s'%(backend, rev, suffix)
-
-def _build(config, exe_name):
-    driver = TranslationDriver.from_targetspec(
-        targetpypystandalone.__dict__,
-        config=config)
-    driver.exe_name = exe_name
-    driver.compile()
-
-def build_pypy_with_options(basedir, opts):
-    config = get_pypy_config(translate.OVERRIDES, translating=True)
-
-    try:
-        config.set(**opts)
-    except:
-        return exe_name_from_options(config, opts), "didn't configure"
-
-    exe_name = os.path.join(basedir, exe_name_from_options(config, opts))
-
-    print exe_name,
-    sys.stdout.flush()
-
-    pid = os.fork()
-
-    if pid == 0:
-        logfile = open(exe_name + '-log', 'w')
-        davenull = os.open('/dev/null', os.O_RDONLY)
-        os.dup2(davenull, 0)
-        os.dup2(logfile.fileno(), 1)
-        os.dup2(logfile.fileno(), 2)
-        try:
-            try:
-                r = _build(config, exe_name)
-            finally:
-                logfile.close()
-        except:
-            os._exit(1)
-        else:
-            os._exit(0)
-    else:
-        pid, status = os.waitpid(pid, 0)
-        if status:
-            r = 'failed'
-        else:
-            r = 'succeeded'
-        print r
-        return exe_name, r
-
-def get_options(fname):
-    def gen_opts(sofar, remaining):
-        if not remaining:
-            yield sofar
-        else:
-            for (k, v) in remaining[0]:
-                d2 = sofar.copy()
-                d2[k] = v
-                for d in gen_opts(d2, remaining[1:]):
-                    yield d
-    options = []
-    for line in open(fname):
-        l = []
-        optname, options_ = line.split(':')
-        options.append([(optname.strip(), eval(optval.strip())) for optval in options_.split(',')])
-    return gen_opts({}, options)
-
-
-if __name__ == '__main__':
-    basedir = sys.argv[1]
-    optionsfile = sys.argv[2]
-    results = []
-    options = list(get_options(optionsfile))
-    random.shuffle(options)
-    for opts in options:
-        results.append(build_pypy_with_options(basedir, opts))
-    out = open(os.path.join(basedir, 'results'), 'w')
-    for exe, r in results:
-        print >>out, exe, r
diff --git a/pypy/module/micronumpy/__init__.py b/pypy/module/micronumpy/__init__.py
--- a/pypy/module/micronumpy/__init__.py
+++ b/pypy/module/micronumpy/__init__.py
@@ -1,14 +1,12 @@
 from pypy.interpreter.mixedmodule import MixedModule
-from pypy.module.micronumpy.interp_boxes import long_double_size
+from pypy.module.micronumpy.interp_boxes import long_double_size, ENABLED_LONG_DOUBLE
 
 
-class Module(MixedModule):
-    applevel_name = '_numpypy'
-
+class MultiArrayModule(MixedModule):
+    appleveldefs = {'arange': 'app_numpy.arange'}
     interpleveldefs = {
         'ndarray': 'interp_numarray.W_NDimArray',
         'dtype': 'interp_dtype.W_Dtype',
-        'ufunc': 'interp_ufuncs.W_Ufunc',
 
         'array': 'interp_numarray.array',
         'zeros': 'interp_numarray.zeros',
@@ -18,17 +16,17 @@
         'fromstring': 'interp_support.fromstring',
         'flatiter': 'interp_flatiter.W_FlatIterator',
         'concatenate': 'interp_arrayops.concatenate',
-        'repeat': 'interp_arrayops.repeat',
         'where': 'interp_arrayops.where',
         'count_nonzero': 'interp_arrayops.count_nonzero',
 
         'set_string_function': 'appbridge.set_string_function',
+        'typeinfo': 'interp_dtype.get_dtype_cache(space).w_typeinfo',
+    }
 
-        'True_': 'types.Bool.True',
-        'False_': 'types.Bool.False',
 
-        'typeinfo': 'interp_dtype.get_dtype_cache(space).w_typeinfo',
-
+class NumericTypesModule(MixedModule):
+    appleveldefs = {}
+    interpleveldefs = {
         'generic': 'interp_boxes.W_GenericBox',
         'number': 'interp_boxes.W_NumberBox',
         'integer': 'interp_boxes.W_IntegerBox',
@@ -59,8 +57,6 @@
         'float16': 'interp_boxes.W_Float16Box',
         'float32': 'interp_boxes.W_Float32Box',
         'float64': 'interp_boxes.W_Float64Box',
-        'longdouble': 'interp_boxes.W_LongDoubleBox',
-        'longfloat': 'interp_boxes.W_LongDoubleBox',
         'intp': 'types.IntP.BoxType',
         'uintp': 'types.UIntP.BoxType',
         'flexible': 'interp_boxes.W_FlexibleBox',
@@ -73,10 +69,31 @@
         'complex_': 'interp_boxes.W_Complex128Box',
         'complex128': 'interp_boxes.W_Complex128Box',
         'complex64': 'interp_boxes.W_Complex64Box',
-        'clongdouble': 'interp_boxes.W_CLongDoubleBox',
-        'clongfloat': 'interp_boxes.W_CLongDoubleBox',
     }
+    if ENABLED_LONG_DOUBLE:
+        long_double_dtypes = [
+            ('longdouble', 'interp_boxes.W_LongDoubleBox'),
+            ('longfloat', 'interp_boxes.W_LongDoubleBox'),
+            ('clongdouble', 'interp_boxes.W_CLongDoubleBox'),
+            ('clongfloat', 'interp_boxes.W_CLongDoubleBox'),
+        ]
+        if long_double_size == 16:
+            long_double_dtypes += [
+                ('float128', 'interp_boxes.W_Float128Box'),
+                ('complex256', 'interp_boxes.W_Complex256Box'),
+            ]
+        elif long_double_size == 12:
+            long_double_dtypes += [
+                ('float96', 'interp_boxes.W_Float96Box'),
+                ('complex192', 'interp_boxes.W_Complex192Box'),
+            ]
+        for dt, box in long_double_dtypes:
+            interpleveldefs[dt] = box
 
+
+class UMathModule(MixedModule):
+    appleveldefs = {}
+    interpleveldefs = {}
     # ufuncs
     for exposed, impl in [
         ("absolute", "absolute"),
@@ -158,22 +175,16 @@
     ]:
         interpleveldefs[exposed] = "interp_ufuncs.get(space).%s" % impl
 
-    appleveldefs = {
-        'arange': 'app_numpy.arange',
+
+class Module(MixedModule):
+    applevel_name = '_numpypy'
+    appleveldefs = {}
+    interpleveldefs = {
+        'choose': 'interp_arrayops.choose',
+        'repeat': 'interp_arrayops.repeat',
     }
-    def setup_after_space_initialization(self):
-        space = self.space
-        all_list = sorted(Module.interpleveldefs.keys() + \
-                                Module.appleveldefs.keys())
-        # found by set(numpypy.__all__) - set(numpy.__all__)
-        all_list.remove('set_string_function')
-        all_list.remove('typeinfo')
-        w_all = space.wrap(all_list)
-        space.setitem(self.w_dict, space.new_interned_str('__all__'), w_all)
-
-if long_double_size == 16:
-    Module.interpleveldefs['float128'] = 'interp_boxes.W_Float128Box'
-    Module.interpleveldefs['complex256'] = 'interp_boxes.W_Complex256Box'
-elif long_double_size == 12:
-    Module.interpleveldefs['float96'] = 'interp_boxes.W_Float96Box'
-    Module.interpleveldefs['complex192'] = 'interp_boxes.W_Complex192Box'
+    submodules = {
+        'multiarray': MultiArrayModule,
+        'numerictypes': NumericTypesModule,
+        'umath': UMathModule,
+    }
diff --git a/pypy/module/micronumpy/app_numpy.py b/pypy/module/micronumpy/app_numpy.py
--- a/pypy/module/micronumpy/app_numpy.py
+++ b/pypy/module/micronumpy/app_numpy.py
@@ -10,9 +10,9 @@
         stop = start
         start = 0
     if dtype is None:
-        test = _numpypy.array([start, stop, step, 0])
+        test = _numpypy.multiarray.array([start, stop, step, 0])
         dtype = test.dtype
-    arr = _numpypy.zeros(int(math.ceil((stop - start) / step)), dtype=dtype)
+    arr = _numpypy.multiarray.zeros(int(math.ceil((stop - start) / step)), dtype=dtype)
     i = start
     for j in range(arr.size):
         arr[j] = i
diff --git a/pypy/module/micronumpy/interp_arrayops.py b/pypy/module/micronumpy/interp_arrayops.py
--- a/pypy/module/micronumpy/interp_arrayops.py
+++ b/pypy/module/micronumpy/interp_arrayops.py
@@ -106,33 +106,36 @@
     args_w = [convert_to_array(space, w_arg) for w_arg in args_w]
     dtype = args_w[0].get_dtype()
     shape = args_w[0].get_shape()[:]
-    if len(shape) <= axis:
+    _axis = axis
+    if axis < 0:
+        _axis = len(shape) + axis
+    if _axis < 0 or len(shape) <= _axis:
         raise operationerrfmt(space.w_IndexError, "axis %d out of bounds [0, %d)", axis, len(shape))
     for arr in args_w[1:]:
         dtype = interp_ufuncs.find_binop_result_dtype(space, dtype,
                                                       arr.get_dtype())
-        if len(arr.get_shape()) <= axis:
+        if _axis < 0 or len(arr.get_shape()) <= _axis:
             raise operationerrfmt(space.w_IndexError, "axis %d out of bounds [0, %d)", axis, len(shape))
         for i, axis_size in enumerate(arr.get_shape()):
-            if len(arr.get_shape()) != len(shape) or (i != axis and axis_size != shape[i]):
+            if len(arr.get_shape()) != len(shape) or (i != _axis and axis_size != shape[i]):
                 raise OperationError(space.w_ValueError, space.wrap(
                     "all the input arrays must have same number of dimensions"))
-            elif i == axis:
+            elif i == _axis:
                 shape[i] += axis_size
     res = W_NDimArray.from_shape(shape, dtype, 'C')
     chunks = [Chunk(0, i, 1, i) for i in shape]
     axis_start = 0
     for arr in args_w:
-        if arr.get_shape()[axis] == 0:
+        if arr.get_shape()[_axis] == 0:
             continue
-        chunks[axis] = Chunk(axis_start, axis_start + arr.get_shape()[axis], 1,
-                             arr.get_shape()[axis])
+        chunks[_axis] = Chunk(axis_start, axis_start + arr.get_shape()[_axis], 1,
+                             arr.get_shape()[_axis])
         Chunks(chunks).apply(res).implementation.setslice(space, arr)
-        axis_start += arr.get_shape()[axis]
+        axis_start += arr.get_shape()[_axis]
     return res
 
 @unwrap_spec(repeats=int)
-def repeat(space, w_arr, repeats, w_axis=None):
+def repeat(space, w_arr, repeats, w_axis):
     arr = convert_to_array(space, w_arr)
     if space.is_none(w_axis):
         arr = arr.descr_flatten(space)
@@ -158,14 +161,21 @@
 def count_nonzero(space, w_obj):
     return space.wrap(loop.count_all_true(convert_to_array(space, w_obj)))
 
-def choose(space, arr, w_choices, out, mode):
+ at unwrap_spec(mode=str)
+def choose(space, w_arr, w_choices, w_out, mode):
+    arr = convert_to_array(space, w_arr)
     choices = [convert_to_array(space, w_item) for w_item
                in space.listview(w_choices)]
     if not choices:
         raise OperationError(space.w_ValueError,
                              space.wrap("choices list cannot be empty"))
-    shape = shape_agreement_multiple(space, choices + [out])
-    out = interp_dtype.dtype_agreement(space, choices, shape, out)
+    if space.is_none(w_out):
+        w_out = None
+    elif not isinstance(w_out, W_NDimArray):
+        raise OperationError(space.w_TypeError, space.wrap(
+            "return arrays must be of ArrayType"))
+    shape = shape_agreement_multiple(space, choices + [w_out])
+    out = interp_dtype.dtype_agreement(space, choices, shape, w_out)
     dtype = out.get_dtype()
     if mode not in MODES:
         raise OperationError(space.w_ValueError,
diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -16,10 +16,12 @@
 MIXIN_64 = (int_typedef,) if LONG_BIT == 64 else ()
 
 # Is this the proper place for this?
+ENABLED_LONG_DOUBLE = False
 long_double_size = rffi.sizeof_c_type('long double', ignore_errors=True)
+
 import os
 if long_double_size == 8 and os.name == 'nt':
-    # this is a lie, or maybe a wish
+    # this is a lie, or maybe a wish, MS fakes longdouble math with double
     long_double_size = 12
 
 
@@ -335,7 +337,7 @@
     descr__new__, _get_dtype = new_dtype_getter("complex128")
     _COMPONENTS_BOX = W_Float64Box
 
-if long_double_size == 12:
+if ENABLED_LONG_DOUBLE and long_double_size == 12:
     class W_Float96Box(W_FloatingBox, PrimitiveBox):
         descr__new__, _get_dtype = new_dtype_getter("float96")
 
@@ -347,7 +349,7 @@
 
     W_CLongDoubleBox = W_Complex192Box
 
-elif long_double_size == 16:
+elif ENABLED_LONG_DOUBLE and long_double_size == 16:
     class W_Float128Box(W_FloatingBox, PrimitiveBox):
         descr__new__, _get_dtype = new_dtype_getter("float128")
     W_LongDoubleBox = W_Float128Box
@@ -358,7 +360,7 @@
 
     W_CLongDoubleBox = W_Complex256Box
 
-else:
+elif ENABLED_LONG_DOUBLE:
     W_LongDoubleBox = W_Float64Box
     W_CLongDoubleBox = W_Complex64Box
 
@@ -526,7 +528,7 @@
     __new__ = interp2app(W_Float64Box.descr__new__.im_func),
 )
 
-if long_double_size == 12:
+if ENABLED_LONG_DOUBLE and long_double_size == 12:
     W_Float96Box.typedef = TypeDef("float96", (W_FloatingBox.typedef),
         __module__ = "numpypy",
 
@@ -540,7 +542,7 @@
         imag = GetSetProperty(W_ComplexFloatingBox.descr_get_imag),
     )
 
-elif long_double_size == 16:
+elif ENABLED_LONG_DOUBLE and long_double_size == 16:
     W_Float128Box.typedef = TypeDef("float128", (W_FloatingBox.typedef),
         __module__ = "numpypy",
 
diff --git a/pypy/module/micronumpy/interp_dtype.py b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -164,8 +164,11 @@
     def is_record_type(self):
         return self.fields is not None
 
+    def is_str_or_unicode(self):
+        return (self.num == 18 or self.num == 19)
+
     def is_flexible_type(self):
-        return (self.num == 18 or self.num == 19 or self.num == 20)
+        return (self.is_str_or_unicode() or self.is_record_type())
 
     def __repr__(self):
         if self.fields is not None:
@@ -416,6 +419,7 @@
             w_box_type=space.gettypefor(interp_boxes.W_ULongBox),
             alternate_constructors=[ space.gettypefor(interp_boxes.W_UnsignedIntegerBox),
                                    ],
+            aliases=['uint'],
         )
         self.w_int64dtype = W_Dtype(
             types.Int64(),
@@ -474,7 +478,7 @@
             aliases=["complex"],
             float_type = self.w_float64dtype,
         )
-        if interp_boxes.long_double_size == 12:
+        if interp_boxes.ENABLED_LONG_DOUBLE and interp_boxes.long_double_size == 12:
             self.w_float96dtype = W_Dtype(
                 types.Float96(),
                 num=13,
@@ -497,7 +501,7 @@
             )
             self.w_longdouble = self.w_float96dtype
             self.w_clongdouble = self.w_complex192dtype
-        elif interp_boxes.long_double_size == 16:
+        elif interp_boxes.ENABLED_LONG_DOUBLE and interp_boxes.long_double_size == 16:
             self.w_float128dtype = W_Dtype(
                 types.Float128(),
                 num=13,
@@ -520,13 +524,13 @@
             )
             self.w_longdouble = self.w_float128dtype
             self.w_clongdouble = self.w_complex256dtype
-        else:
+        elif interp_boxes.ENABLED_LONG_DOUBLE:
             self.w_float64dtype.aliases += ["longdouble", "longfloat"]
             self.w_complex128dtype.aliases += ["clongdouble", "clongfloat"]
             self.w_longdouble = self.w_float64dtype
             self.w_clongdouble = self.w_complex128dtype
         self.w_stringdtype = W_Dtype(
-            types.StringType(1),
+            types.StringType(0),
             num=18,
             kind=STRINGLTR,
             name='string',
@@ -596,23 +600,27 @@
             char=UINTPLTR,
             w_box_type = space.gettypefor(uintp_box),
         )
+        float_dtypes = [self.w_float16dtype,
+                self.w_float32dtype, self.w_float64dtype,
+                ]
+        complex_dtypes =  [self.w_complex64dtype, self.w_complex128dtype]
+        if interp_boxes.ENABLED_LONG_DOUBLE:
+            float_dtypes.append(self.w_longdouble)
+            complex_dtypes.append(self.w_clongdouble)
         self.builtin_dtypes = [
             self.w_booldtype,
             self.w_int8dtype, self.w_uint8dtype,
             self.w_int16dtype, self.w_uint16dtype,
             self.w_longdtype, self.w_ulongdtype,
             self.w_int32dtype, self.w_uint32dtype,
-            self.w_int64dtype, self.w_uint64dtype,
-            self.w_float16dtype,
-            self.w_float32dtype, self.w_float64dtype, self.w_longdouble,
-            self.w_complex64dtype, self.w_complex128dtype, self.w_clongdouble,
+            self.w_int64dtype, self.w_uint64dtype] + \
+            float_dtypes + complex_dtypes + [
             self.w_stringdtype, self.w_unicodedtype, self.w_voiddtype,
             self.w_intpdtype, self.w_uintpdtype,
         ]
         self.float_dtypes_by_num_bytes = sorted(
             (dtype.itemtype.get_element_size(), dtype)
-            for dtype in [self.w_float16dtype, self.w_float32dtype,
-                          self.w_float64dtype, self.w_longdouble]
+            for dtype in float_dtypes
         )
         self.dtypes_by_num = {}
         self.dtypes_by_name = {}
@@ -655,7 +663,6 @@
             'LONGLONG': self.w_int64dtype,
             'SHORT': self.w_int16dtype,
             'VOID': self.w_voiddtype,
-            'LONGDOUBLE': self.w_longdouble,
             'UBYTE': self.w_uint8dtype,
             'UINTP': self.w_ulongdtype,
             'ULONG': self.w_ulongdtype,
@@ -678,8 +685,11 @@
             'USHORT': self.w_uint16dtype,
             'FLOAT': self.w_float32dtype,
             'BOOL': self.w_booldtype,
-            'CLONGDOUBLE': self.w_clongdouble,
         }
+        if interp_boxes.ENABLED_LONG_DOUBLE:
+            typeinfo_full['LONGDOUBLE'] = self.w_longdouble
+            typeinfo_full['CLONGDOUBLE'] = self.w_clongdouble
+
         typeinfo_partial = {
             'Generic': interp_boxes.W_GenericBox,
             'Character': interp_boxes.W_CharacterBox,
diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -14,7 +14,7 @@
 from pypy.module.micronumpy.appbridge import get_appbridge_cache
 from pypy.module.micronumpy import loop
 from pypy.module.micronumpy.dot import match_dot_shapes
-from pypy.module.micronumpy.interp_arrayops import repeat
+from pypy.module.micronumpy.interp_arrayops import repeat, choose
 from rpython.tool.sourcetools import func_with_new_name
 from rpython.rlib import jit
 from rpython.rlib.rstring import StringBuilder
@@ -452,13 +452,8 @@
             return res
 
     @unwrap_spec(mode=str)
-    def descr_choose(self, space, w_choices, mode='raise', w_out=None):
-        if space.is_none(w_out):
-            w_out = None
-        elif not isinstance(w_out, W_NDimArray):
-            raise OperationError(space.w_TypeError, space.wrap(
-                "return arrays must be of ArrayType"))
-        return interp_arrayops.choose(space, self, w_choices, w_out, mode)
+    def descr_choose(self, space, w_choices, w_out=None, mode='raise'):
+        return choose(space, self, w_choices, w_out, mode)
 
     def descr_clip(self, space, w_min, w_max, w_out=None):
         if space.is_none(w_out):
@@ -932,7 +927,8 @@
         return w_object
 
     shape, elems_w = find_shape_and_elems(space, w_object, dtype)
-    if dtype is None:
+    if dtype is None or (
+                 dtype.is_str_or_unicode() and dtype.itemtype.get_size() < 1):
         for w_elem in elems_w:
             dtype = interp_ufuncs.find_dtype_for_scalar(space, w_elem,
                                                         dtype)
@@ -941,6 +937,9 @@
 
         if dtype is None:
             dtype = interp_dtype.get_dtype_cache(space).w_float64dtype
+    if dtype.is_str_or_unicode() and dtype.itemtype.get_size() < 1:
+        # promote S0 -> S1, U0 -> U1
+        dtype = interp_dtype.variable_dtype(space, dtype.char + '1')
     if ndmin > len(shape):
         shape = [1] * (ndmin - len(shape)) + shape
     arr = W_NDimArray.from_shape(shape, dtype, order=order)
diff --git a/pypy/module/micronumpy/interp_ufuncs.py b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -258,6 +258,9 @@
         if w_obj.get_dtype().is_flexible_type():
             raise OperationError(space.w_TypeError, 
                       space.wrap('Not implemented for this type'))
+        if self.int_only and not w_obj.get_dtype().is_int_type():
+            raise OperationError(space.w_TypeError, space.wrap(
+                "ufunc %s not supported for the input type" % self.name))
         calc_dtype = find_unaryop_result_dtype(space,
                                   w_obj.get_dtype(),
                                   promote_to_float=self.promote_to_float,
@@ -337,6 +340,9 @@
             promote_bools=self.promote_bools,
             allow_complex=self.allow_complex,
             )
+        if self.int_only and not calc_dtype.is_int_type():
+            raise OperationError(space.w_TypeError, space.wrap(
+                "ufunc '%s' not supported for the input types" % self.name))
         if space.is_none(w_out):
             out = None
         elif not isinstance(w_out, W_NDimArray):
@@ -400,7 +406,7 @@
             return interp_dtype.get_dtype_cache(space).w_complex64dtype
         elif dt2.num == 15:
             return interp_dtype.get_dtype_cache(space).w_complex128dtype
-        elif dt2.num == 16:
+        elif interp_boxes.ENABLED_LONG_DOUBLE and dt2.num == 16:
             return interp_dtype.get_dtype_cache(space).w_clongdouble
         else:
             raise OperationError(space.w_TypeError, space.wrap("Unsupported types"))
diff --git a/pypy/module/micronumpy/test/test_arrayops.py b/pypy/module/micronumpy/test/test_arrayops.py
--- a/pypy/module/micronumpy/test/test_arrayops.py
+++ b/pypy/module/micronumpy/test/test_arrayops.py
@@ -3,26 +3,26 @@
 
 class AppTestNumSupport(BaseNumpyAppTest):
     def test_where(self):
-        from _numpypy import where, ones, zeros, array
+        from numpypy import where, ones, zeros, array
         a = [1, 2, 3, 0, -3]
         a = where(array(a) > 0, ones(5), zeros(5))
         assert (a == [1, 1, 1, 0, 0]).all()
 
     def test_where_differing_dtypes(self):
-        from _numpypy import array, ones, zeros, where
+        from numpypy import array, ones, zeros, where
         a = [1, 2, 3, 0, -3]
         a = where(array(a) > 0, ones(5, dtype=int), zeros(5, dtype=float))
         assert (a == [1, 1, 1, 0, 0]).all()
 
     def test_where_broadcast(self):
-        from _numpypy import array, where
+        from numpypy import array, where
         a = where(array([[1, 2, 3], [4, 5, 6]]) > 3, [1, 1, 1], 2)
         assert (a == [[2, 2, 2], [1, 1, 1]]).all()
         a = where(True, [1, 1, 1], 2)
         assert (a == [1, 1, 1]).all()
 
     def test_where_errors(self):
-        from _numpypy import where, array
+        from numpypy import where, array
         raises(ValueError, "where([1, 2, 3], [3, 4, 5])")
         raises(ValueError, "where([1, 2, 3], [3, 4, 5], [6, 7])")
         assert where(True, 1, 2) == array(1)
@@ -35,7 +35,7 @@
     #    xxx
 
     def test_where_invalidates(self):
-        from _numpypy import where, ones, zeros, array
+        from numpypy import where, ones, zeros, array
         a = array([1, 2, 3, 0, -3])
         b = where(a > 0, ones(5), zeros(5))
         a[0] = 0
@@ -43,7 +43,7 @@
 
 
     def test_dot(self):
-        from _numpypy import array, dot, arange
+        from numpypy import array, dot, arange
         a = array(range(5))
         assert dot(a, a) == 30.0
 
@@ -74,7 +74,7 @@
         assert (dot([[1,2],[3,4]],[5,6]) == [17, 39]).all()
 
     def test_dot_constant(self):
-        from _numpypy import array, dot
+        from numpypy import array, dot
         a = array(range(5))
         b = a.dot(2.5)
         for i in xrange(5):
@@ -85,19 +85,21 @@
         assert c == 12.0
 
     def test_choose_basic(self):
-        from _numpypy import array
+        from numpypy import array, choose
         a, b, c = array([1, 2, 3]), array([4, 5, 6]), array([7, 8, 9])
         r = array([2, 1, 0]).choose([a, b, c])
         assert (r == [7, 5, 3]).all()
+        r = choose(array([2, 1, 0]), [a, b, c])
+        assert (r == [7, 5, 3]).all()
 
     def test_choose_broadcast(self):
-        from _numpypy import array
+        from numpypy import array
         a, b, c = array([1, 2, 3]), [4, 5, 6], 13
         r = array([2, 1, 0]).choose([a, b, c])
         assert (r == [13, 5, 3]).all()
 
     def test_choose_out(self):
-        from _numpypy import array
+        from numpypy import array
         a, b, c = array([1, 2, 3]), [4, 5, 6], 13
         r = array([2, 1, 0]).choose([a, b, c], out=None)
         assert (r == [13, 5, 3]).all()
@@ -107,10 +109,10 @@
         assert (a == [13, 5, 3]).all()
 
     def test_choose_modes(self):
-        from _numpypy import array
+        from numpypy import array
         a, b, c = array([1, 2, 3]), [4, 5, 6], 13
         raises(ValueError, "array([3, 1, 0]).choose([a, b, c])")
-        raises(ValueError, "array([3, 1, 0]).choose([a, b, c], 'raises')")
+        raises(ValueError, "array([3, 1, 0]).choose([a, b, c], mode='raises')")
         raises(ValueError, "array([3, 1, 0]).choose([])")
         raises(ValueError, "array([-1, -2, -3]).choose([a, b, c])")
         r = array([4, 1, 0]).choose([a, b, c], mode='clip')
@@ -119,13 +121,13 @@
         assert (r == [4, 5, 3]).all()
 
     def test_choose_dtype(self):
-        from _numpypy import array
+        from numpypy import array
         a, b, c = array([1.2, 2, 3]), [4, 5, 6], 13
         r = array([2, 1, 0]).choose([a, b, c])
         assert r.dtype == float
 
     def test_choose_dtype_out(self):
-        from _numpypy import array
+        from numpypy import array
         a, b, c = array([1, 2, 3]), [4, 5, 6], 13
         x = array([0, 0, 0], dtype='i2')
         r = array([2, 1, 0]).choose([a, b, c], out=x)
diff --git a/pypy/module/micronumpy/test/test_base.py b/pypy/module/micronumpy/test/test_base.py
--- a/pypy/module/micronumpy/test/test_base.py
+++ b/pypy/module/micronumpy/test/test_base.py
@@ -17,7 +17,6 @@
             if '__pypy__' not in sys.builtin_module_names:
                 import numpy
                 sys.modules['numpypy'] = numpy
-                sys.modules['_numpypy'] = numpy
         cls.w_non_native_prefix = cls.space.wrap(nonnative_byteorder_prefix)
         cls.w_native_prefix = cls.space.wrap(byteorder_prefix)
 
diff --git a/pypy/module/micronumpy/test/test_complex.py b/pypy/module/micronumpy/test/test_complex.py
--- a/pypy/module/micronumpy/test/test_complex.py
+++ b/pypy/module/micronumpy/test/test_complex.py
@@ -132,13 +132,13 @@
             cls.w_c_pow = cls.space.wrap(interp2app(cls_c_pow))
 
     def test_fabs(self):
-        from _numpypy import fabs, complex128
+        from numpypy import fabs, complex128
 
         a = complex128(complex(-5., 5.))
         raises(TypeError, fabs, a)
 
     def test_fmax(self):
-        from _numpypy import fmax, array
+        from numpypy import fmax, array
         nnan, nan, inf, ninf = float('-nan'), float('nan'), float('inf'), float('-inf')
         a = array((complex(ninf, 10), complex(10, ninf), 
                    complex( inf, 10), complex(10,  inf),
@@ -165,7 +165,7 @@
         assert (fmax(a, b) == res).all()
 
     def test_fmin(self):
-        from _numpypy import fmin, array
+        from numpypy import fmin, array
         nnan, nan, inf, ninf = float('-nan'), float('nan'), float('inf'), float('-inf')
         a = array((complex(ninf, 10), complex(10, ninf), 
                    complex( inf, 10), complex(10,  inf),
@@ -192,12 +192,17 @@
         assert (fmin(a, b) == res).all()
 
     def test_signbit(self):
-        from _numpypy import signbit
+        from numpypy import signbit
         raises(TypeError, signbit, complex(1,1))
 
     def test_reciprocal(self):
-        from _numpypy import array, reciprocal, complex64, complex128, clongdouble
-
+        from numpypy import array, reciprocal, complex64, complex128
+        c_and_relerr = [(complex64, 2e-7), (complex128, 2e-15)]
+        try:
+            from numpypy import clongdouble
+            c_and_relerr.append((clongdouble, 2e-30))
+        except:
+            pass # no longdouble yet
         inf = float('inf')
         nan = float('nan')
         #complex    
@@ -212,32 +217,38 @@
                     complex(-r, i), 
                     -0j, 0j, cnan, 
                     cnan, cnan, cnan]
-        for c, rel_err in ((complex64, 2e-7), (complex128, 2e-15), (clongdouble, 2e-15)):
+        for c, rel_err in c_and_relerr:
             actual = reciprocal(array([orig], dtype=c))
             for b, a, e in zip(orig, actual, expected):
                 assert (a[0].real - e.real) < rel_err
                 assert (a[0].imag - e.imag) < rel_err
 
     def test_floorceiltrunc(self):
-        from _numpypy import array, floor, ceil, trunc
+        from numpypy import array, floor, ceil, trunc
         a = array([ complex(-1.4, -1.4), complex(-1.5, -1.5)]) 
         raises(TypeError, floor, a)
         raises(TypeError, ceil, a)
         raises(TypeError, trunc, a)
 
     def test_copysign(self):
-        from _numpypy import copysign, complex128
+        from numpypy import copysign, complex128
         a = complex128(complex(-5., 5.))
         b = complex128(complex(0., 0.))
         raises(TypeError, copysign, a, b)
 
     def test_exp2(self):
-        from _numpypy import array, exp2, complex128, complex64, clongfloat
+        from numpypy import array, exp2, complex128, complex64
+        c_and_relerr = [(complex64, 2e-7), (complex128, 2e-15)]
+        try:
+            from numpypy import clongdouble
+            c_and_relerr.append((clongdouble, 2e-30))
+        except:
+            pass # no longdouble yet
         inf = float('inf')
         ninf = -float('inf')
         nan = float('nan')
         cmpl = complex
-        for c,rel_err in ((complex128, 2e-15), (complex64, 1e-7), (clongfloat, 2e-15)):
+        for c,rel_err in c_and_relerr:
             a = [cmpl(-5., 0), cmpl(-5., -5.), cmpl(-5., 5.),
                        cmpl(0., -5.), cmpl(0., 0.), cmpl(0., 5.),
                        cmpl(-0., -5.), cmpl(-0., 0.), cmpl(-0., 5.),
@@ -268,7 +279,7 @@
 
     def test_expm1(self):
         import math, cmath
-        from _numpypy import array, expm1, complex128, complex64
+        from numpypy import array, expm1, complex128, complex64
         inf = float('inf')
         ninf = -float('inf')
         nan = float('nan')
@@ -307,7 +318,7 @@
                 self.rAlmostEqual(t1, t2, rel_err=rel_err, msg=msg)
 
     def test_not_complex(self):
-        from _numpypy import (radians, deg2rad, degrees, rad2deg,
+        from numpypy import (radians, deg2rad, degrees, rad2deg,
                   isneginf, isposinf, logaddexp, logaddexp2, fmod,
                   arctan2)
         raises(TypeError, radians, complex(90,90))
@@ -322,7 +333,7 @@
         raises (TypeError, fmod, complex(90,90), 3) 
 
     def test_isnan_isinf(self):
-        from _numpypy import isnan, isinf, array
+        from numpypy import isnan, isinf, array
         assert (isnan(array([0.2+2j, complex(float('inf'),0), 
                 complex(0,float('inf')), complex(0,float('nan')),
                 complex(float('nan'), 0)], dtype=complex)) == \
@@ -335,7 +346,7 @@
 
 
     def test_square(self):
-        from _numpypy import square
+        from numpypy import square
         assert square(complex(3, 4)) == complex(3,4) * complex(3, 4)
 
     def test_power_complex(self):
@@ -344,7 +355,7 @@
         nan = float('nan')
         cmpl = complex
         from math import copysign
-        from _numpypy import power, array, complex128, complex64
+        from numpypy import power, array, complex128, complex64
         # note: in some settings (namely a x86-32 build without the JIT),
         # gcc optimizes the code in rlib.rcomplex.c_pow() to not truncate
         # the 10-byte values down to 8-byte values.  It ends up with more
@@ -381,7 +392,7 @@
                     self.rAlmostEqual(t1, t2, rel_err=rel_err, msg=msg)
 
     def test_conjugate(self):
-        from _numpypy import conj, conjugate, complex128, complex64
+        from numpypy import conj, conjugate, complex128, complex64
         import numpypy as np
 
         c0 = complex128(complex(2.5, 0))
@@ -405,7 +416,7 @@
     def test_logn(self):
         import math, cmath
         # log and log10 are tested in math (1:1 from rcomplex)
-        from _numpypy import log2, array, complex128, complex64, log1p
+        from numpypy import log2, array, complex128, complex64, log1p
         inf = float('inf')
         ninf = -float('inf')
         nan = float('nan')
@@ -462,7 +473,7 @@
                 self.rAlmostEqual(t1, t2, rel_err=rel_err, msg=msg)
 
     def test_logical_ops(self):
-        from _numpypy import logical_and, logical_or, logical_xor, logical_not
+        from numpypy import logical_and, logical_or, logical_xor, logical_not
 
         c1 = complex(1, 1)
         c3 = complex(3, 0)
@@ -476,7 +487,7 @@
         assert (logical_not([c1, c0]) == [False, True]).all()
 
     def test_minimum(self):
-        from _numpypy import array, minimum
+        from numpypy import array, minimum
 
         a = array([-5.0+5j, -5.0-5j, -0.0-10j, 1.0+10j])
         b = array([ 3.0+10.0j, 3.0, -2.0+2.0j, -3.0+4.0j])
@@ -485,7 +496,7 @@
             assert c[i] == min(a[i], b[i])
 
     def test_maximum(self):
-        from _numpypy import array, maximum
+        from numpypy import array, maximum
 
         a = array([-5.0+5j, -5.0-5j, -0.0-10j, 1.0+10j])
         b = array([ 3.0+10.0j, 3.0, -2.0+2.0j, -3.0+4.0j])
@@ -494,17 +505,23 @@
             assert c[i] == max(a[i], b[i])
 
     def test_basic(self):
-        from _numpypy import (complex128, complex64, add, array, dtype,
+        from numpypy import (complex128, complex64, add, array, dtype,
             subtract as sub, multiply, divide, negative, absolute as abs,
-            floor_divide, real, imag, sign, clongfloat)
-        from _numpypy import (equal, not_equal, greater, greater_equal, less,
+            floor_divide, real, imag, sign)
+        from numpypy import (equal, not_equal, greater, greater_equal, less,
                 less_equal, isnan)
+        complex_dtypes = [complex64, complex128]
+        try:
+            from numpypy import clongfloat
+            complex_dtypes.append(clongfloat)
+        except:
+            pass
         assert real(4.0) == 4.0
         assert imag(0.0) == 0.0
         a = array([complex(3.0, 4.0)])
         b = a.real
         assert b.dtype == dtype(float)
-        for complex_ in complex64, complex128, clongfloat:
+        for complex_ in complex_dtypes:
 
             O = complex(0, 0)
             c0 = complex_(complex(2.5, 0))
@@ -571,15 +588,15 @@
             inf_c = complex_(complex(float('inf'), 0.))
             assert repr(abs(inf_c)) == 'inf'
             assert repr(abs(complex(float('nan'), float('nan')))) == 'nan'
-            # numpy actually raises an AttributeError, 
-            # but _numpypy raises a TypeError
+            # numpy actually raises an AttributeError,
+            # but numpypy raises a TypeError
             raises((TypeError, AttributeError), 'c2.real = 10.')
             raises((TypeError, AttributeError), 'c2.imag = 10.')
             assert(real(c2) == 3.0)
             assert(imag(c2) == 4.0)
 
     def test_conj(self):
-        from _numpypy import array
+        from numpypy import array
 
         a = array([1 + 2j, 1 - 2j])
         assert (a.conj() == [1 - 2j, 1 + 2j]).all()
@@ -588,7 +605,7 @@
         if self.isWindows:
             skip('windows does not support c99 complex')
         import sys
-        import _numpypy as np
+        import numpypy as np
         rAlmostEqual = self.rAlmostEqual
 
         for complex_, abs_err, testcases in (\
diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -14,10 +14,10 @@
             from rpython.rtyper.lltypesystem import rffi
             ptr_size = rffi.sizeof(rffi.CCHARP)
         cls.w_ptr_size = cls.space.wrap(ptr_size)
-
+    
 class AppTestDtypes(BaseAppTestDtypes):
     def test_dtype(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         d = dtype('?')
         assert d.num == 0
@@ -36,22 +36,15 @@
         raises(KeyError, 'dtype(int)["asdasd"]')
 
     def test_dtype_eq(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         assert dtype("int8") == "int8"
         assert "int8" == dtype("int8")
         raises(TypeError, lambda: dtype("int8") == 3)
         assert dtype(bool) == bool
 
-    def test_dtype_aliases(self):
-        from _numpypy import dtype
-        assert dtype('longfloat').num in (12, 13)
-        assert dtype('longdouble').num in (12, 13)
-        assert dtype('clongfloat').num in (15, 16)
-        assert dtype('clongdouble').num in (15, 16)
-
     def test_dtype_with_types(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         assert dtype(bool).num == 0
         if self.ptr_size == 4:
@@ -69,16 +62,20 @@
             assert dtype('int64').num == 7
             assert dtype('uint64').num == 8
         assert dtype(int).num == 7
+        assert dtype('int').num == 7
+        assert dtype('uint').num == 8
         assert dtype(float).num == 12
+        assert dtype('float').num == 12
+        assert dtype('complex').num == 15
 
     def test_array_dtype_attr(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
 
         a = array(list(range(5)), int)
         assert a.dtype is dtype(int)
 
     def test_repr_str(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         assert '.dtype' in repr(dtype)
         d = dtype('?')
@@ -86,7 +83,7 @@
         assert str(d) == "bool"
 
     def test_bool_array(self):
-        from _numpypy import array, False_, True_
+        from numpypy import array, False_, True_
 
         a = array([0, 1, 2, 2.5], dtype='?')
         assert a[0] is False_
@@ -94,7 +91,7 @@
             assert a[i] is True_
 
     def test_copy_array_with_dtype(self):
-        from _numpypy import array, False_, longlong
+        from numpypy import array, longlong, False_
 
         a = array([0, 1, 2, 3], dtype=int)
         # int on 64-bit, long in 32-bit
@@ -108,35 +105,35 @@
         assert b[0] is False_
 
     def test_zeros_bool(self):
-        from _numpypy import zeros, False_
+        from numpypy import zeros, False_
 
         a = zeros(10, dtype=bool)
         for i in range(10):
             assert a[i] is False_
 
     def test_ones_bool(self):
-        from _numpypy import ones, True_
+        from numpypy import ones, True_
 
         a = ones(10, dtype=bool)
         for i in range(10):
             assert a[i] is True_
 
     def test_zeros_long(self):
-        from _numpypy import zeros, longlong
+        from numpypy import zeros, longlong
         a = zeros(10, dtype=int)
         for i in range(10):
             assert isinstance(a[i], longlong)
             assert a[1] == 0
 
     def test_ones_long(self):
-        from _numpypy import ones, longlong
+        from numpypy import ones, longlong
         a = ones(10, dtype=int)
         for i in range(10):
             assert isinstance(a[i], longlong)
             assert a[1] == 1
 
     def test_overflow(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
         assert array([128], 'b')[0] == -128
         assert array([256], 'B')[0] == 0
         assert array([32768], 'h')[0] == -32768
@@ -148,19 +145,17 @@
         raises(OverflowError, "array([2**64], 'Q')")
 
     def test_bool_binop_types(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
         types = [
             '?', 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q', 'f', 'd', 
             'e'
         ]
-        if array([0], dtype='longdouble').itemsize > 8:
-            types += ['g', 'G']
         a = array([True], '?')
         for t in types:
             assert (a + array([0], t)).dtype is dtype(t)
 
     def test_binop_types(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
         tests = [('b','B','h'), ('b','h','h'), ('b','H','i'), ('b','i','i'),
                  ('b','l','l'), ('b','q','q'), ('b','Q','d'), ('B','h','h'),
                  ('B','H','H'), ('B','i','i'), ('B','I','I'), ('B','l','l'),
@@ -184,7 +179,7 @@
             assert (d1, d2) == (d1, d2) and d3 is dtype(dout)
 
     def test_add_int8(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
 
         a = array(list(range(5)), dtype="int8")
         b = a + a
@@ -193,7 +188,7 @@
             assert b[i] == i * 2
 
     def test_add_int16(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
 
         a = array(list(range(5)), dtype="int16")
         b = a + a
@@ -202,7 +197,7 @@
             assert b[i] == i * 2
 
     def test_add_uint32(self):
-        from _numpypy import array, dtype
+        from numpypy import array, dtype
 
         a = array(list(range(5)), dtype="I")
         b = a + a
@@ -211,49 +206,49 @@
             assert b[i] == i * 2
 
     def test_shape(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         assert dtype(int).shape == ()
 
     def test_cant_subclass(self):
-        from _numpypy import dtype
+        from numpypy import dtype
         # You can't subclass dtype
         raises(TypeError, type, "Foo", (dtype,), {})
 
     def test_can_subclass(self):
-        import _numpypy
-        class xyz(_numpypy.void):
+        import numpypy
+        class xyz(numpypy.void):
             pass
         assert True
 
     def test_aliases(self):
-        from _numpypy import dtype
+        from numpypy import dtype
 
         assert dtype("float") is dtype(float)
 
     def test_index_int8(self):
-        from _numpypy import array, int8
+        from numpypy import array, int8
 
         a = array(range(10), dtype=int8)
         b = array([0] * 10, dtype=int8)
         for idx in b: a[idx] += 1
 
     def test_index_int16(self):
-        from _numpypy import array, int16
+        from numpypy import array, int16
 
         a = array(range(10), dtype=int16)
         b = array([0] * 10, dtype=int16)
         for idx in b: a[idx] += 1
 
     def test_index_int32(self):
-        from _numpypy import array, int32
+        from numpypy import array, int32
 
         a = array(range(10), dtype=int32)
         b = array([0] * 10, dtype=int32)
         for idx in b: a[idx] += 1
 
     def test_index_int64(self):
-        from _numpypy import array, int64
+        from numpypy import array, int64
 
         a = array(range(10), dtype=int64)
         b = array([0] * 10, dtype=int64)
@@ -261,7 +256,7 @@
             a[idx] += 1
 
     def test_hash(self):
-        import _numpypy as numpy
+        import numpypy as numpy
         for tp, value in [
             (numpy.int8, 4),
             (numpy.int16, 5),
@@ -270,14 +265,13 @@
             (numpy.float16, 10.),
             (numpy.float32, 2.0),
             (numpy.float64, 4.32),
-            (numpy.longdouble, 4.32),
         ]:
             assert hash(tp(value)) == hash(value)
 
 
 class AppTestTypes(BaseAppTestDtypes):
     def test_abstract_types(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         raises(TypeError, numpy.generic, 0)
         raises(TypeError, numpy.number, 0)
@@ -317,16 +311,16 @@
         #assert a.dtype is numpy.dtype('|V4')
 
     def test_new(self):
-        import _numpypy as np
+        import numpypy as np
         assert np.int_(4) == 4
         assert np.float_(3.4) == 3.4
 
     def test_pow(self):
-        from _numpypy import int_
+        from numpypy import int_
         assert int_(4) ** 2 == 16
 
     def test_bool(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.bool_.mro() == [numpy.bool_, numpy.generic, object]
         assert numpy.bool_(3) is numpy.True_
@@ -341,7 +335,7 @@
         assert numpy.bool_("False") is numpy.True_
 
     def test_int8(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.int8.mro() == [numpy.int8, numpy.signedinteger,
                                     numpy.integer, numpy.number, 
@@ -365,7 +359,7 @@
         assert numpy.int8('128') == -128
 
     def test_uint8(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.uint8.mro() == [numpy.uint8, numpy.unsignedinteger, 
                                      numpy.integer, numpy.number, 
@@ -390,7 +384,7 @@
         assert numpy.uint8('256') == 0
 
     def test_int16(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         x = numpy.int16(3)
         assert x == 3
@@ -400,7 +394,7 @@
         assert numpy.int16('32768') == -32768
 
     def test_uint16(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.uint16(65535) == 65535
         assert numpy.uint16(65536) == 0
@@ -409,7 +403,7 @@
 
     def test_int32(self):
         import sys
-        import _numpypy as numpy
+        import numpypy as numpy
 
         x = numpy.int32(23)
         assert x == 23
@@ -425,7 +419,7 @@
 
     def test_uint32(self):
         import sys
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.uint32(10) == 10
 
@@ -436,7 +430,7 @@
             assert numpy.uint32('4294967296') == 0
 
     def test_int_(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.int_ is numpy.dtype(int).type
         assert numpy.int_.mro() == [numpy.int_, numpy.signedinteger, 
@@ -445,7 +439,7 @@
 
     def test_int64(self):
         import sys
-        import _numpypy as numpy
+        import numpypy as numpy
 
         if sys.maxsize == 2 ** 63 -1:
             assert numpy.int64.mro() == [numpy.int64, numpy.signedinteger, 
@@ -467,7 +461,7 @@
 
     def test_uint64(self):
         import sys
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.uint64.mro() == [numpy.uint64, numpy.unsignedinteger, 
                                       numpy.integer, numpy.number, 
@@ -484,7 +478,7 @@
         raises(OverflowError, numpy.uint64(18446744073709551616))
 
     def test_float16(self):
-        import _numpypy as numpy
+        import numpypy as numpy
         assert numpy.float16.mro() == [numpy.float16, numpy.floating, 
                                        numpy.inexact, numpy.number, 
                                        numpy.generic, object]
@@ -495,7 +489,7 @@
 
 
     def test_float32(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.float32.mro() == [numpy.float32, numpy.floating, 
                                        numpy.inexact, numpy.number, 
@@ -506,7 +500,7 @@
         raises(ValueError, numpy.float32, '23.2df')
 
     def test_float64(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.float64.mro() == [numpy.float64, numpy.floating, 
                                        numpy.inexact, numpy.number, 
@@ -523,34 +517,20 @@
         raises(ValueError, numpy.float64, '23.2df')
 
     def test_float_None(self):
-        import _numpypy as numpy
+        import numpypy as numpy
         from math import isnan
         assert isnan(numpy.float32(None))
         assert isnan(numpy.float64(None))
-        assert isnan(numpy.longdouble(None))
-
-    def test_longfloat(self):
-        import _numpypy as numpy
-        # it can be float96 or float128
-        if numpy.longfloat != numpy.float64:
-            assert numpy.longfloat.mro()[1:] == [numpy.floating,
-                                       numpy.inexact, numpy.number, 
-                                       numpy.generic, object]
-        a = numpy.array([1, 2, 3], numpy.longdouble)
-        assert type(a[1]) is numpy.longdouble
-        assert numpy.float64(12) == numpy.longdouble(12)
-        assert numpy.float64(12) == numpy.longfloat(12)
-        raises(ValueError, numpy.longfloat, '23.2df')
 
     def test_complex_floating(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.complexfloating.__mro__ == (numpy.complexfloating,
             numpy.inexact, numpy.number, numpy.generic, object)
 
     def test_complex_format(self):
         import sys
-        import _numpypy as numpy
+        import numpypy as numpy
 
         for complex_ in (numpy.complex128, numpy.complex64,):
             for real, imag, should in [
@@ -590,7 +570,7 @@
             assert "{:g}".format(numpy.complex_(0.5+1.5j)) == '{:g}'.format(0.5+1.5j)
 
     def test_complex(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.complex_ is numpy.complex128
         assert numpy.complex64.__mro__ == (numpy.complex64,
@@ -608,7 +588,7 @@
         assert d.char == 'F'
 
     def test_subclass_type(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         class X(numpy.float64):
             def m(self):
@@ -619,12 +599,12 @@
         assert b.m() == 12
 
     def test_long_as_index(self):
-        from _numpypy import int_, float64
+        from numpypy import int_, float64
         assert (1, 2, 3)[int_(1)] == 2
         raises(TypeError, lambda: (1, 2, 3)[float64(1)])
 
     def test_int(self):
-        from _numpypy import int32, int64, int_
+        from numpypy import int32, int64, int_
         import sys
         assert issubclass(int_, int)
         if sys.maxsize == (1<<31) - 1:
@@ -635,7 +615,7 @@
             assert int_ is int64
 
     def test_various_types(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.int16 is numpy.short
         assert numpy.int8 is numpy.byte
@@ -648,7 +628,7 @@
             assert numpy.uintp is numpy.uint64
 
     def test_mro(self):
-        import _numpypy as numpy
+        import numpypy as numpy
 
         assert numpy.int16.__mro__ == (numpy.int16, numpy.signedinteger,
                                        numpy.integer, numpy.number,
@@ -657,7 +637,7 @@
 
     def test_operators(self):
         from operator import truediv
-        from _numpypy import float64, int_, True_, False_
+        from numpypy import float64, int_, True_, False_
         assert 5 / int_(2) == int_(2)
         assert truediv(int_(3), int_(2)) == float64(1.5)
         assert truediv(3, int_(2)) == float64(1.5)
@@ -682,7 +662,7 @@
         raises(TypeError, lambda: float64(3) & 1)
 
     def test_alternate_constructs(self):


More information about the pypy-commit mailing list