Repository: numba/numba

Issue:
Wrong dtype of array inside reflected list
When trying to overload a numpy function that expects a list or tuple of boolean arrays there's a funny asymmetric behaviour going on. It looks like a bug, although maybe it's intended to be like this. When trying to query the dtype of the array, in one case it is `reflected list(array(int64, 1d, C))` and in the other one is `int64`. I think the second case should be the right answer in both cases.

```python
from numba import njit
from numba.extending import overload

@overload(np.select)
def np_select(arg):
    print('arg type', type(arg), '\narg[0] type', type(arg[0]), '\narg[0].dtype', arg[0].dtype)

@nb.njit
def test(arg):
    return np.select(arg)

test([np.arange(3)])
```
out when passing a list:
```python
arg type <class 'numba.types.containers.List'> 
arg[0] type <class 'numba.types.npytypes.Array'> 
arg[0].dtype reflected list(array(int64, 1d, C))
```
When passing a tuple
```
test((np.arange(3),))
```
out:
```python
arg type <class 'numba.types.containers.UniTuple'> 
arg[0] type <class 'numba.types.npytypes.Array'> 
arg[0].dtype int64
```
 



Discussion:

Patch:
diff --git a/.flake8 b/.flake8
index bc7b7caf5..4bc32404f 100644
--- a/.flake8
+++ b/.flake8
@@ -40,6 +40,7 @@ exclude =
     numba/parfor.py
     numba/numba_entry.py
     numba/stencilparfor.py
+    numba/numpy_support.py
     numba/ir.py
     numba/itanium_mangler.py
     numba/unittest_support.py
@@ -249,6 +250,7 @@ exclude =
     numba/tests/cffi_usecases.py
     numba/tests/test_slices.py
     numba/tests/test_mandelbrot.py
+    numba/tests/test_numpy_support.py
     numba/tests/compile_with_pycc.py
     numba/tests/test_ir.py
     numba/tests/test_deprecations.py
@@ -334,6 +336,7 @@ exclude =
     numba/tests/test_sets.py
     numba/tests/test_dyn_array.py
     numba/tests/test_objects.py
+    numba/tests/test_record_dtype.py
     numba/tests/test_types.py
     numba/tests/test_random.py
     numba/tests/test_nan.py
diff --git a/docs/source/developer/contributing.rst b/docs/source/developer/contributing.rst
index 1ee5b48dc..4f5bf5b7c 100644
--- a/docs/source/developer/contributing.rst
+++ b/docs/source/developer/contributing.rst
@@ -176,12 +176,12 @@ following test runner options:
 * The ``--failed-first`` option is added to capture the list of failed tests
   and to re-execute them first::
 
-    $ python -m numba.runtests --failed-first -m -v -b
+    $ python -m numba.runtests --failed-first -mvb
 
 * The ``--last-failed`` option is used with ``--failed-first`` to execute
   the previously failed tests only::
 
-    $ python -m numba.runtests --last-failed -m -v -b
+    $ python -m numba.runtests --last-failed -mvb
 
 Development rules
 -----------------
diff --git a/docs/source/developer/index.rst b/docs/source/developer/index.rst
index f36759e31..a6087a85a 100644
--- a/docs/source/developer/index.rst
+++ b/docs/source/developer/index.rst
@@ -8,7 +8,6 @@ Developer Manual
    :maxdepth: 2
 
    contributing.rst
-   repomap.rst
    architecture.rst
    dispatching.rst
    generators.rst
diff --git a/docs/source/developer/repomap.rst b/docs/source/developer/repomap.rst
deleted file mode 100644
index aaf92e3b4..000000000
--- a/docs/source/developer/repomap.rst
+++ /dev/null
@@ -1,646 +0,0 @@
-A Map of the Numba Repository
-=============================
-
-The Numba repository is quite large, and due to age has functionality spread
-around many locations.  To help orient developers, this document will try to
-summarize where different categories of functionality can be found.
-
-.. note::
-    It is likely that the organization of the code base will change in the
-    future to improve organization.  Follow `issue #3807 <https://github.com/numba/numba/issues/3807>`_
-    for more details.
-
-
-Support Files
--------------
-
-Build and Packaging
-'''''''''''''''''''
-
-- ``setup.py`` - Standard Python distutils/setuptools script
-- ``MANIFEST.in`` - Distutils packaging instructions
-- ``requirements.txt`` - Pip package requirements, not used by conda
-- ``versioneer.py`` - Handles automatic setting of version in
-  installed package from git tags
-- ``.flake8`` - Preferences for code formatting.  Files should be
-  fixed and removed from the exception list as time allows.
-- ``buildscripts/condarecipe.local`` - Conda build recipe
-- ``buildscripts/remove_unwanted_files.py`` - Helper script to remove
-  files that will not compile under Python 2. Used by build recipes.
-- ``buildscripts/condarecipe_clone_icc_rt`` - Recipe to build a
-  standalone icc_rt package.
-
-
-Continuous Integration
-''''''''''''''''''''''
-- ``.binstar.yml`` - Binstar Build CI config (inactive)
-- ``azure-pipelines.yml`` - Azure Pipelines CI config (active:
-  Win/Mac/Linux)
-- ``buildscripts/azure/`` - Azure Pipeline configuration for specific
-  platforms
-- ``.travis.yml`` - Travis CI config (active: Mac/Linux, will be
-  dropped in the future)
-- ``appveyor.yml`` - Appveyor CI config (inactive: Win)
-- ``buildscripts/appveyor/`` - Appveyor build scripts
-- ``buildscripts/incremental/`` - Generic scripts for building Numba
-  on various CI systems
-- ``codecov.yml`` - Codecov.io coverage reporting
-
-
-Documentation / Examples
-''''''''''''''''''''''''
-- ``LICENSE`` - License for Numba
-- ``LICENSES.third-party`` - License for third party code vendored
-  into Numba
-- ``README.rst`` - README for repo, also uploaded to PyPI
-- ``CONTRIBUTING.md`` - Documentation on how to contribute to project
-  (out of date, should be updated to point to Sphinx docs)
-- ``AUTHORS`` - List of Github users who have contributed PRs (out of
-  date)
-- ``CHANGE_LOG`` - History of Numba releases, also directly embedded
-  into Sphinx documentation
-- ``docs/`` - Documentation source
-- ``docs/_templates/`` - Directory for templates (to override defaults
-  with Sphinx theme)
-- ``docs/Makefile`` - Used to build Sphinx docs with ``make``
-- ``docs/source`` - ReST source for Numba documentation
-- ``docs/_static/`` - Static CSS and image assets for Numba docs
-- ``docs/gh-pages.py`` - Utility script to update Numba docs (stored
-  as gh-pages)
-- ``docs/make.bat`` - Not used (remove?)
-- ``examples/`` - Example scripts demonstrating numba (re/move to
-  numba-examples repo?)
-- ``examples/notebooks/`` - Example notebooks (re/move to
-  numba-examples repo?)
-- ``benchmarks/`` - Benchmark scripts (re/move to numba-examples
-  repo?)
-- ``tutorials/`` - Tutorial notebooks (definitely out of date, should
-  remove and direct to external tutorials)
-- ``numba/scripts/generate_lower_listing.py`` - Dump all registered
-  implementations decorated with ``@lower*`` for reference
-  documentation.  Currently misses implementations from the higher
-  level extension API.
-
-
-
-Numba Source Code
------------------
-
-Numba ships with both the source code and tests in one package.
-
-- ``numba/`` - all of the source code and tests
-
-
-Public API
-''''''''''
-
-These define aspects of the public Numba interface.
-
-- ``numba/decorators.py`` - User-facing decorators for compiling
-  regular functions on the CPU
-- ``numba/extending.py`` - Public decorators for extending Numba
-  (``overload``, ``intrinsic``, etc)
-- ``numba/ccallback.py`` - ``@cfunc`` decorator for compiling
-  functions to a fixed C signature.  Used to make callbacks.
-- ``numba/npyufunc/decorators.py`` - ufunc/gufunc compilation
-  decorators
-- ``numba/config.py`` - Numba global config options and environment
-  variable handling
-- ``numba/annotations`` - Gathering and printing type annotations of
-  Numba IR
-- ``numba/pretty_annotate.py`` - Code highlighting of Numba functions
-  and types (both ANSI terminal and HTML)
-
-
-Dispatching
-'''''''''''
-
-- ``numba/dispatcher.py`` - Dispatcher objects are compiled functions
-  produced by ``@jit``.  A dispatcher has different implementations
-  for different type signatures.
-- ``numba/_dispatcher.{h,c}`` - C interface to C++ dispatcher
-  implementation
-- ``numba/_dispatcherimpl.cpp`` - C++ dispatcher implementation (for
-  speed on common data types)
-
-
-Compiler Pipeline
-'''''''''''''''''
-
-- ``numba/compiler.py`` - Compiler pipelines and flags
-- ``numba/errors.py`` - Numba exception and warning classes 
-- ``numba/ir.py`` - Numba IR data structure objects
-- ``numba/bytecode.py`` - Bytecode parsing and function identity (??)
-- ``numba/interpreter.py`` - Translate Python interpreter bytecode to
-  Numba IR
-- ``numba/analysis.py`` - Utility functions to analyze Numba IR
-  (variable lifetime, prune branches, etc)
-- ``numba/dataflow.py`` - Dataflow analysis for Python bytecode (used
-  in analysis.py)
-- ``numba/controlflow.py`` - Control flow analysis of Numba IR and
-  Python bytecode
-- ``numba/typeinfer.py`` - Type inference algorithm
-- ``numba/transforms.py`` - Numba IR transformations
-- ``numba/rewrites`` - Rewrite passes used by compiler
-- ``numba/rewrites/__init__.py`` - Loads all rewrite passes so they
-  are put into the registry
-- ``numba/rewrites/registry.py`` - Registry object for collecting
-  rewrite passes
-- ``numba/rewrites/ir_print.py`` - Write print() calls into special
-  print nodes in the IR
-- ``numba/rewrites/static_raise.py`` - Converts exceptions with static
-  arguments into a special form that can be lowered
-- ``numba/rewrites/macros.py`` - Generic support for macro expansion
-  in the Numba IR
-- ``numba/rewrites/static_getitem.py`` - Rewrites getitem and setitem
-  with constant arguments to allow type inference
-- ``numba/rewrites/static_binop.py`` - Rewrites binary operations
-  (specifically ``**``) with constant arguments so faster code can be
-  generated
-- ``numba/inline_closurecall.py`` - Inlines body of closure functions
-  to call site.  Support for array comprehensions, reduction inlining, 
-  and stencil inlining.
-- ``numba/macro.py`` - Alias to ``numba.rewrites.macros``
-- ``numba/postproc.py`` - Postprocessor for Numba IR that computes
-  variable lifetime, inserts del operations, and handles generators
-- ``numba/lowering.py`` - General implementation of lowering Numba IR
-  to LLVM
-- ``numba/withcontexts.py`` - General scaffolding for implementing
-  context managers in nopython mode, and the objectmode context
-  manager
-- ``numba/pylowering.py`` - Lowering of Numba IR in object mode
-- ``numba/pythonapi.py`` - LLVM IR code generation to interface with
-  CPython API
-
-
-Type Management
-'''''''''''''''
-
-- ``numba/typeconv/`` - Implementation of type casting and type
-  signature matching in both C++ and Python
-- ``numba/capsulethunk.h`` - Used by typeconv
-- ``numba/types/`` - definition of the Numba type hierarchy, used
-  everywhere in compiler to select implementations
-- ``numba/consts.py`` - Constant inference (used to make constant
-  values available during codegen when possible)
-- ``numba/datamodel`` - LLVM IR representations of data types in
-  different contexts
-- ``numba/datamodel/models.py`` - Models for most standard types
-- ``numba/datamodel/registry.py`` - Decorator to register new data
-  models
-- ``numba/datamodel/packer.py`` - Pack typed values into a data
-  structure
-- ``numba/datamodel/testing.py`` - Data model tests (this should
-  move??)
-- ``numba/datamodel/manager.py`` - Map types to data models
-
-
-Compiled Extensions
-'''''''''''''''''''
-
-Numba uses a small amount of compiled C/C++ code for core
-functionality, like dispatching and type matching where performance
-matters, and it is more convenient to encapsulate direct interaction
-with CPython APIs.
-
-- ``numba/_arraystruct.h`` - Struct for holding NumPy array
-  attributes.  Used in helperlib and the Numba Runtime.
-- ``numba/_helperlib.c`` - C functions required by Numba compiled code
-  at runtime.  Linked into ahead-of-time compiled modules
-- ``numba/_helpermod.c`` - Python extension module with pointers to
-  functions from ``_helperlib.c`` and ``_npymath_exports.c``
-- ``numba/_npymath_exports.c`` - Export function pointer table to
-  NumPy C math functions
-- ``numba/_dynfuncmod.c`` - Python extension module exporting
-  _dynfunc.c functionality
-- ``numba/_dynfunc.c`` - C level Environment and Closure objects (keep
-  in sync with numba/target/base.py)
-- ``numba/mathnames.h`` - Macros for defining names of math functions
-- ``numba/_pymodule.h`` - C macros for Python 2/3 portable naming of C
-  API functions
-- ``numba/_math_c99.{h,c}`` - C99 math compatibility (needed Python
-  2.7 on Windows, compiled with VS2008)
-- ``numba/mviewbuf.c`` - Handles Python memoryviews
-- ``numba/_typeof.{h,c}`` - C implementation of type fingerprinting,
-  used by dispatcher
-- ``numba/_numba_common.h`` - Portable C macro for marking symbols
-  that can be shared between object files, but not outside the
-  library.
-
-
-
-Misc Support
-''''''''''''
-
-- ``numba/_version.py`` - Updated by versioneer
-- ``numba/runtime`` - Language runtime.  Currently manages
-  reference-counted memory allocated on the heap by Numba-compiled
-  functions
-- ``numba/ir_utils.py`` - Utility functions for working with Numba IR
-  data structures
-- ``numba/cgutils.py`` - Utility functions for generating common code
-  patterns in LLVM IR
-- ``numba/six.py`` - Vendored subset of ``six`` package for Python 2 +
-  3 compatibility
-- ``numba/io_support.py`` - Workaround for various names of StringIO
-  in different Python versions (should this be in six?)
-- ``numba/utils.py`` - Python 2 backports of Python 3 functionality
-  (also imports local copy of ``six``)
-- ``numba/appdirs.py`` - Vendored package for determining application
-  config directories on every platform
-- ``numba/compiler_lock.py`` - Global compiler lock because Numba's usage
-  of LLVM is not thread-safe
-- ``numba/special.py`` - Python stub implementations of special Numba
-  functions (prange, gdb*)
-- ``numba/servicelib/threadlocal.py`` - Thread-local stack used by GPU
-  targets
-- ``numba/servicelib/service.py`` - Should be removed?
-- ``numba/itanium_mangler.py`` - Python implementation of Itanium C++
-  name mangling
-- ``numba/findlib.py`` - Helper function for locating shared libraries
-  on all platforms
-- ``numba/debuginfo.py`` - Helper functions to construct LLVM IR debug
-  info
-- ``numba/unsafe`` - ``@intrinsic`` helper functions that can be used
-  to implement direct memory/pointer manipulation from nopython mode
-  functions
-- ``numba/unsafe/refcount.py`` - Read reference count of object
-- ``numba/unsafe/tuple.py`` - Replace a value in a tuple slot
-- ``numba/unsafe/ndarray.py`` - NumPy array helpers
-- ``numba/unsafe/bytes.py`` - Copying and dereferencing data from void
-  pointers
-- ``numba/dummyarray.py`` - Used by GPU backends to hold array information
-  on the host, but not the data.
-- ``numba/callwrapper.py`` - Handles argument unboxing and releasing
-  the GIL when moving from Python to nopython mode
-- ``numba/ctypes_support.py`` - Import this instead of ``ctypes`` to
-  workaround portability issue with Python 2.7
-- ``numba/cffi_support.py`` - Alias of numba.typing.cffi_utils for
-  backward compatibility (still needed?)
-- ``numba/numpy_support.py`` - Helper functions for working with NumPy
-  and translating Numba types to and from NumPy dtypes.
-- ``numba/tracing.py`` - Decorator for tracing Python calls and
-  emitting log messages
-- ``numba/funcdesc.py`` - Classes for describing function metadata
-  (used in the compiler)
-- ``numba/sigutils.py`` - Helper functions for parsing and normalizing
-  Numba type signatures
-- ``numba/serialize.py`` - Support for pickling compiled functions
-- ``numba/caching.py`` - Disk cache for compiled functions
-- ``numba/npdatetime.py`` - Helper functions for implementing NumPy
-  datetime64 support
-
-
-Core Python Data Types
-''''''''''''''''''''''
-
-- ``numba/_hashtable.{h,c}`` - Adaptation of the Python 3.7 hash table
-  implementation
-- ``numba/_dictobject.{h,c}`` - C level implementation of typed
-  dictionary
-- ``numba/dictobject.py`` - Nopython mode wrapper for typed dictionary
-- ``numba/unicode.py`` - Unicode strings (Python 3.5 and later)
-- ``numba/typed`` - Python interfaces to statically typed containers
-- ``numba/typed/typeddict.py`` - Python interface to typed dictionary
-- ``numba/jitclass`` - Implementation of JIT compilation of Python
-  classes
-- ``numba/generators.py`` - Support for lowering Python generators
-
-
-Math
-''''
-
-- ``numba/_random.c`` - Reimplementation of NumPy / CPython random
-  number generator
-- ``numba/_lapack.c`` - Wrappers for calling BLAS and LAPACK functions
-  (requires SciPy)
-
-
-ParallelAccelerator
-'''''''''''''''''''
-
-Code transformation passes that extract parallelizable code from
-a function and convert it into multithreaded gufunc calls.
-
-- ``numba/parfor.py`` - General ParallelAccelerator
-- ``numba/stencil.py`` - Stencil function decorator (implemented
-  without ParallelAccelerator)
-- ``numba/stencilparfor.py`` - ParallelAccelerator implementation of
-  stencil
-- ``numba/array_analysis.py`` - Array analysis passes used in
-  ParallelAccelerator
-
-
-Deprecated Functionality
-''''''''''''''''''''''''
-
-- ``numba/smartarray.py`` - Experiment with an array object that has
-  both CPU and GPU backing.  Should be removed in future.
-
-
-Debugging Support
-'''''''''''''''''
-
-- ``numba/targets/gdb_hook.py`` - Hooks to jump into GDB from nopython
-  mode
-- ``numba/targets/cmdlang.gdb`` - Commands to setup GDB for setting
-  explicit breakpoints from Python
-
-
-Type Signatures (CPU)
-'''''''''''''''''''''
-
-Some (usually older) Numba supported functionality separates the
-declaration of allowed type signatures from the definition of
-implementations.  This package contains registries of type signatures
-that must be matched during type inference.
-
-- ``numba/typing`` - Type signature module
-- ``numba/typing/templates.py`` - Base classes for type signature
-  templates
-- ``numba/typing/cmathdecl.py`` - Python complex math (``cmath``)
-  module
-- ``numba/typing/bufproto.py`` - Interpreting objects supporting the
-  buffer protocol
-- ``numba/typing/mathdecl.py`` - Python ``math`` module
-- ``numba/typing/listdecl.py`` - Python lists
-- ``numba/typing/builtins.py`` - Python builtin global functions and
-  operators
-- ``numba/typing/randomdecl.py`` - Python and NumPy ``random`` modules
-- ``numba/typing/setdecl.py`` - Python sets
-- ``numba/typing/npydecl.py`` - NumPy ndarray (and operators), NumPy
-  functions
-- ``numba/typing/arraydecl.py`` - Python ``array`` module
-- ``numba/typing/context.py`` - Implementation of typing context
-  (class that collects methods used in type inference)
-- ``numba/typing/collections.py`` - Generic container operations and
-  namedtuples
-- ``numba/typing/ctypes_utils.py`` - Typing ctypes-wrapped function
-  pointers
-- ``numba/typing/enumdecl.py`` - Enum types
-- ``numba/typing/cffi_utils.py`` - Typing of CFFI objects
-- ``numba/typing/typeof.py`` - Implementation of typeof operations
-  (maps Python object to Numba type)
-- ``numba/typing/npdatetime.py`` - Datetime dtype support for NumPy
-  arrays
-
-
-Target Implementations (CPU)
-''''''''''''''''''''''''''''
-
-Implementations of Python / NumPy functions and some data models.
-These modules are responsible for generating LLVM IR during lowering.
-Note that some of these modules do not have counterparts in the typing
-package because newer Numba extension APIs (like overload) allow
-typing and implementation to be specified together.
-
-- ``numba/targets`` - Implementations of compilable operations
-- ``numba/targets/cpu.py`` - Context for code gen on CPU
-- ``numba/targets/base.py`` - Base class for all target contexts
-- ``numba/targets/codegen.py`` - Driver for code generation
-- ``numba/targets/boxing.py`` - Boxing and unboxing for most data
-  types
-- ``numba/targets/intrinsics.py`` - Utilities for converting LLVM
-  intrinsics to other math calls
-- ``numba/targets/callconv.py`` - Implements different calling
-  conventions for Numba-compiled functions
-- ``numba/targets/iterators.py`` - Iterable data types and iterators
-- ``numba/targets/hashing.py`` - Hashing algorithms
-- ``numba/targets/ufunc_db.py`` - Big table mapping types to ufunc
-  implementations
-- ``numba/targets/setobj.py`` - Python set type
-- ``numba/targets/options.py`` - Container for options that control
-  lowering
-- ``numba/targets/printimpl.py`` - Print function
-- ``numba/targets/smartarray.py`` - Smart array (deprecated)
-- ``numba/targets/cmathimpl.py`` - Python complex math module
-- ``numba/targets/optional.py`` - Special type representing value or
-  ``None``
-- ``numba/targets/tupleobj.py`` - Tuples (statically typed as
-  immutable struct)
-- ``numba/targets/mathimpl.py`` - Python ``math`` module
-- ``numba/targets/heapq.py`` - Python ``heapq`` module
-- ``numba/targets/registry.py`` - Registry object for collecting
-  implementations for a specific target
-- ``numba/targets/imputils.py`` - Helper functions for lowering
-- ``numba/targets/builtins.py`` - Python builtin functions and
-  operators
-- ``numba/targets/externals.py`` - Registers external C functions
-  needed to link generated code
-- ``numba/targets/quicksort.py`` - Quicksort implementation used with
-  list and array objects
-- ``numba/targets/mergesort.py`` - Mergesort implementation used with
-  array objects
-- ``numba/targets/randomimpl.py`` - Python and NumPy ``random``
-  modules
-- ``numba/targets/npyimpl.py`` - Implementations of most NumPy ufuncs
-- ``numba/targets/slicing.py`` - Slice objects, and index calculations
-  used in slicing
-- ``numba/targets/numbers.py`` - Numeric values (int, float, etc)
-- ``numba/targets/listobj.py`` - Python lists
-- ``numba/targets/fastmathpass.py`` - Rewrite pass to add fastmath
-  attributes to function call sites and binary operations
-- ``numba/targets/removerefctpass.py`` - Rewrite pass to remove
-  unnecessary incref/decref pairs
-- ``numba/targets/cffiimpl.py`` - CFFI functions
-- ``numba/targets/descriptors.py`` - empty base class for all target
-  descriptors (is this needed?)
-- ``numba/targets/arraymath.py`` - Math operations on arrays (both
-  Python and NumPy)
-- ``numba/targets/linalg.py`` - NumPy linear algebra operations
-- ``numba/targets/rangeobj.py`` - Python `range` objects
-- ``numba/targets/npyfuncs.py`` - Kernels used in generating some
-  NumPy ufuncs
-- ``numba/targets/arrayobj.py`` - Array operations (both NumPy and
-  buffer protocol)
-- ``numba/targets/enumimpl.py`` - Enum objects
-- ``numba/targets/polynomial.py`` - ``numpy.roots`` function
-- ``numba/targets/npdatetime.py`` - NumPy datetime operations
-
-
-Ufunc Compiler and Runtime
-''''''''''''''''''''''''''
-
-- ``numba/npyufunc`` - ufunc compiler implementation
-- ``numba/npyufunc/_internal.{h,c}`` - Python extension module with
-  helper functions that use CPython & NumPy C API
-- ``numba/npyufunc/_ufunc.c`` - Used by `_internal.c`
-- ``numba/npyufunc/deviceufunc.py`` - Custom ufunc dispatch for
-  non-CPU targets
-- ``numba/npyufunc/gufunc_scheduler.{h,cpp}`` - Schedule work chunks
-  to threads
-- ``numba/npyufunc/dufunc.py`` - Special ufunc that can compile new
-  implementations at call time
-- ``numba/npyufunc/ufuncbuilder.py`` - Top-level orchestration of
-  ufunc/gufunc compiler pipeline
-- ``numba/npyufunc/sigparse.py`` - Parser for generalized ufunc
-  indexing signatures
-- ``numba/npyufunc/parfor.py`` - gufunc lowering for
-  ParallelAccelerator
-- ``numba/npyufunc/parallel.py`` - Codegen for ``parallel`` target
-- ``numba/npyufunc/array_exprs.py`` - Rewrite pass for turning array
-  expressions in regular functions into ufuncs
-- ``numba/npyufunc/wrappers.py`` - Wrap scalar function kernel with
-  loops
-- ``numba/npyufunc/workqueue.{h,c}`` - Threading backend based on
-  pthreads/Windows threads and queues
-- ``numba/npyufunc/omppool.cpp`` - Threading backend based on OpenMP
-- ``numba/npyufunc/tbbpool.cpp`` - Threading backend based on TBB
-
-
-
-Unit Tests (CPU)
-''''''''''''''''
-
-CPU unit tests (GPU target unit tests listed in later sections
-
-- ``runtests.py`` - Convenience script that launches test runner and
-  turns on full compiler tracebacks
-- ``run_coverage.py`` - Runs test suite with coverage tracking enabled
-- ``.coveragerc`` - Coverage.py configuration
-- ``numba/runtests.py`` - Entry point to unittest runner
-- ``numba/_runtests.py`` - Implementation of custom test runner
-  command line interface
-- ``numba/tests/test_*`` - Test cases
-- ``numba/tests/*_usecases.py`` - Python functions compiled by some
-  unit tests
-- ``numba/tests/support.py`` - Helper functions for testing and
-  special TestCase implementation
-- ``numba/tests/dummy_module.py`` - Module used in
-  ``test_dispatcher.py``
-- ``numba/tests/npyufunc`` - ufunc / gufunc compiler tests
-- ``numba/unittest_support.py`` - Import instead of unittest to handle
-  portability issues
-- ``numba/testing`` - Support code for testing
-- ``numba/testing/ddt.py`` - decorators for test cases
-- ``numba/testing/loader.py`` - Find tests on disk
-- ``numba/testing/notebook.py`` - Support for testing notebooks
-- ``numba/testing/main.py`` - Numba test runner
-
-
-Command Line Utilities
-''''''''''''''''''''''
-- ``bin/numba`` - Command line stub, delegates to main in
-  ``numba_entry.py``
-- ``numba/numba_entry.py`` - Main function for ``numba`` command line
-  tool
-- ``numba/pycc`` - Ahead of time compilation of functions to shared
-  library extension
-- ``numba/pycc/__init__.py`` - Main function for ``pycc`` command line
-  tool
-- ``numba/pycc/cc.py`` - User-facing API for tagging functions to
-  compile ahead of time
-- ``numba/pycc/compiler.py`` - Compiler pipeline for creating
-  standalone Python extension modules
-- ``numba/pycc/llvm_types.py`` - Aliases to LLVM data types used by
-  ``compiler.py``
-- ``numba/pycc/pycc`` - Stub to call main function.  Is this still
-  used?
-- ``numba/pycc/modulemixin.c`` - C file compiled into every compiled
-  extension.  Pulls in C source from Numba core that is needed to make
-  extension standalone
-- ``numba/pycc/platform.py`` - Portable interface to platform-specific
-  compiler toolchains
-- ``numba/pycc/decorators.py`` - Deprecated decorators for tagging
-  functions to compile.  Use ``cc.py`` instead.
-
-
-CUDA GPU Target
-'''''''''''''''
-
-Note that the CUDA target does reuse some parts of the CPU target.
-
-- ``numba/cuda/`` - The implementation of the CUDA (NVIDIA GPU) target
-  and associated unit tests
-- ``numba/cuda/decorators.py`` - Compiler decorators for CUDA kernels
-  and device functions
-- ``numba/cuda/dispatcher.py`` - Dispatcher for CUDA JIT functions
-- ``numba/cuda/printimpl.py`` - Special implementation of device printing
-- ``numba/cuda/libdevice.py`` - Registers libdevice functions
-- ``numba/cuda/kernels/`` - Custom kernels for reduction and transpose 
-- ``numba/cuda/device_init.py`` - Initializes the CUDA target when
-  imported
-- ``numba/cuda/compiler.py`` - Compiler pipeline for CUDA target
-- ``numba/cuda/intrinsic_wrapper.py`` - CUDA device intrinsics
-  (shuffle, ballot, etc)
-- ``numba/cuda/initialize.py`` - Defered initialization of the CUDA
-  device and subsystem.  Called only when user imports ``numba.cuda``
-- ``numba/cuda/simulator_init.py`` - Initalizes the CUDA simulator
-  subsystem (only when user requests it with env var)
-- ``numba/cuda/random.py`` - Implementation of random number generator
-- ``numba/cuda/api.py`` - User facing APIs imported into ``numba.cuda.*``
-- ``numba/cuda/stubs.py`` - Python placeholders for functions that
-  only can be used in GPU device code
-- ``numba/cuda/simulator/`` - Simulate execution of CUDA kernels in
-  Python interpreter
-- ``numba/cuda/vectorizers.py`` - Subclasses of ufunc/gufunc compilers
-  for CUDA
-- ``numba/cuda/args.py`` - Management of kernel arguments, including
-  host<->device transfers
-- ``numba/cuda/target.py`` - Typing and target contexts for GPU
-- ``numba/cuda/cudamath.py`` - Type signatures for math functions in
-  CUDA Python
-- ``numba/cuda/errors.py`` - Validation of kernel launch configuration
-- ``numba/cuda/nvvmutils.py`` - Helper functions for generating
-  NVVM-specific IR
-- ``numba/cuda/testing.py`` - Support code for creating CUDA unit
-  tests and capturing standard out
-- ``numba/cuda/cudadecl.py`` - Type signatures of CUDA API (threadIdx,
-  blockIdx, atomics) in Python on GPU
-- ``numba/cuda/cudaimpl.py`` - Implementations of CUDA API functions
-  on GPU
-- ``numba/cuda/codegen.py`` - Code generator object for CUDA target
-- ``numba/cuda/cudadrv/`` - Wrapper around CUDA driver API
-- ``numba/cuda/tests/`` - CUDA unit tests, skipped when CUDA is not
-  detected
-- ``numba/cuda/tests/cudasim/`` - Tests of CUDA simulator
-- ``numba/cuda/tests/nocuda/`` - Tests for NVVM functionality when
-  CUDA not present
-- ``numba/cuda/tests/cudapy/`` - Tests of compiling Python functions
-  for GPU
-- ``numba/cuda/tests/cudadrv/`` - Tests of Python wrapper around CUDA
-  API
-
-
-ROCm GPU Target
-'''''''''''''''
-
-Note that the ROCm target does reuse some parts of the CPU target, and
-duplicates some code from CUDA target.  A future refactoring could
-pull out the common subset of CUDA and ROCm.  An older version of this
-target was based on the HSA API, so "hsa" appears in many places.
-
-- ``numba/roc`` - ROCm GPU target for AMD GPUs
-- ``numba/roc/descriptor.py`` - TargetDescriptor subclass for ROCm
-  target
-- ``numba/roc/enums.py`` - Internal constants
-- ``numba/roc/mathdecl.py`` - Declarations of math functions that can
-  be used on device
-- ``numba/roc/mathimpl.py`` - Implementations of math functions for
-  device
-- ``numba/roc/compiler.py`` - Compiler pipeline for ROCm target
-- ``numba/roc/hlc`` - Wrapper around LLVM interface for AMD GPU
-- ``numba/roc/initialize.py`` - Register ROCm target for ufunc/gufunc
-  compiler
-- ``numba/roc/hsadecl.py`` - Type signatures for ROCm device API in
-  Python
-- ``numba/roc/hsaimpl.py`` - Implementations of ROCm device API
-- ``numba/roc/dispatch.py`` - ufunc/gufunc dispatcher
-- ``numba/roc/README.md`` - Notes on testing target (should be
-  deleted)
-- ``numba/roc/api.py`` - Host API for ROCm actions
-- ``numba/roc/gcn_occupancy.py`` - Heuristic to compute occupancy of
-  kernels
-- ``numba/roc/stubs.py`` - Host stubs for device functions
-- ``numba/roc/vectorizers.py`` - Builds ufuncs
-- ``numba/roc/target.py`` - Target and typing contexts
-- ``numba/roc/hsadrv`` - Python wrapper around ROCm (based on HSA)
-  driver API calls
-- ``numba/roc/codegen.py`` - Codegen subclass for ROCm target
-- ``numba/roc/decorators.py`` - ``@jit`` decorator for kernels and
-  device functions
-- ``numba/roc/tests`` - Unit tests for ROCm target
-- ``numba/roc/tests/hsapy`` - Tests of compiling ROCm kernels written
-  in Python syntax
-- ``numba/roc/tests/hsadrv`` - Tests of Python wrapper on platform
-  API.
diff --git a/docs/source/reference/numpysupported.rst b/docs/source/reference/numpysupported.rst
index d096bce60..c49fd2610 100644
--- a/docs/source/reference/numpysupported.rst
+++ b/docs/source/reference/numpysupported.rst
@@ -310,7 +310,6 @@ The following top-level functions are supported:
   SciPy >= 0.16; extreme value handling per NumPy 1.11+)
 * :func:`numpy.correlate` (only the 2 first arguments)
 * :func:`numpy.cov` (only the 5 first arguments, requires NumPy >= 1.10 and SciPy >= 0.16)
-* :func:`numpy.delete` (only the 2 first arguments)
 * :func:`numpy.diag`
 * :func:`numpy.digitize`
 * :func:`numpy.dstack`
diff --git a/docs/source/reference/pysupported.rst b/docs/source/reference/pysupported.rst
index bf5cbf23a..4a5646820 100644
--- a/docs/source/reference/pysupported.rst
+++ b/docs/source/reference/pysupported.rst
@@ -174,7 +174,6 @@ The following functions, attributes and methods are currently supported:
 * ``.find()``
 * ``.split()``
 * ``.join()``
-* ``.zfill()``
 
 Additional operations as well as support for Python 2 strings / Python 3 bytes
 will be added in a future version of Numba.  Python 2 Unicode objects will
diff --git a/numba/_helperlib.c b/numba/_helperlib.c
index ced6ebb79..56f1f7943 100644
--- a/numba/_helperlib.c
+++ b/numba/_helperlib.c
@@ -1092,13 +1092,11 @@ numba_unpickle(const char *data, int n)
 
 NUMBA_EXPORT_FUNC(void *)
 numba_extract_unicode(PyObject *obj, Py_ssize_t *length, int *kind,
-                      unsigned int *ascii, Py_ssize_t *hash) {
+                      Py_ssize_t *hash) {
 #if (PY_MAJOR_VERSION >= 3) && (PY_MINOR_VERSION >= 3)
     if (!PyUnicode_READY(obj)) {
         *length = PyUnicode_GET_LENGTH(obj);
         *kind = PyUnicode_KIND(obj);
-        /* could also use PyUnicode_IS_ASCII but it is not publicly advertised in https://docs.python.org/3/c-api/unicode.html */
-        *ascii = (unsigned int)(PyUnicode_MAX_CHAR_VALUE(obj) == (0x7f));
         /* this is here as a crude check for safe casting of all unicode string
          * structs to a PyASCIIObject */
         if (MEMBER_SIZE(PyCompactUnicodeObject, _base) == sizeof(PyASCIIObject)             &&
diff --git a/numba/cuda/compiler.py b/numba/cuda/compiler.py
index 15b88a846..8229f7ee3 100644
--- a/numba/cuda/compiler.py
+++ b/numba/cuda/compiler.py
@@ -104,8 +104,6 @@ class DeviceFunctionTemplate(object):
 
         Each signature is compiled once by caching the compiled function inside
         this object.
-
-        Returns the `CompileResult`.
         """
         if args not in self._compileinfos:
             cres = compile_cuda(self.py_func, None, args, debug=self.debug,
@@ -124,46 +122,7 @@ class DeviceFunctionTemplate(object):
         else:
             cres = self._compileinfos[args]
 
-        return cres
-
-    def inspect_llvm(self, args):
-        """Returns the LLVM-IR text compiled for *args*.
-
-        Parameters
-        ----------
-        args: tuple[Type]
-            Argument types.
-
-        Returns
-        -------
-        llvmir : str
-        """
-        cres = self._compileinfos[args]
-        mod = cres.library._final_module
-        return str(mod)
-
-    def inspect_ptx(self, args, nvvm_options={}):
-        """Returns the PTX compiled for *args* for the currently active GPU
-
-        Parameters
-        ----------
-        args: tuple[Type]
-            Argument types.
-        nvvm_options : dict; optional
-            See `CompilationUnit.compile` in `numba/cuda/cudadrv/nvvm.py`.
-
-        Returns
-        -------
-        ptx : bytes
-        """
-        llvmir = self.inspect_llvm(args)
-        # Make PTX
-        cuctx = get_context()
-        device = cuctx.device
-        cc = device.compute_capability
-        arch = nvvm.get_arch_option(*cc)
-        ptx = nvvm.llvm_to_ptx(llvmir, opt=3, arch=arch, **nvvm_options)
-        return ptx
+        return cres.signature
 
 
 def compile_device_template(pyfunc, debug=False, inline=False):
@@ -179,7 +138,7 @@ def compile_device_template(pyfunc, debug=False, inline=False):
 
         def generic(self, args, kws):
             assert not kws
-            return dft.compile(args).signature
+            return dft.compile(args)
 
     typingctx = CUDATargetDesc.typingctx
     typingctx.insert_user_function(dft, device_function_template)
diff --git a/numba/ir_utils.py b/numba/ir_utils.py
index 16a12d8d3..bf6f2540d 100644
--- a/numba/ir_utils.py
+++ b/numba/ir_utils.py
@@ -701,10 +701,6 @@ def find_potential_aliases(blocks, args, typemap, func_ir, alias_map=None,
                 if (isinstance(expr, ir.Expr) and expr.op == 'getattr'
                         and expr.attr in ['T', 'ctypes', 'flat']):
                     _add_alias(lhs, expr.value.name, alias_map, arg_aliases)
-                # a = b.c.  a should alias b
-                if (isinstance(expr, ir.Expr) and expr.op == 'getattr'
-                        and expr.value.name in arg_aliases):
-                    _add_alias(lhs, expr.value.name, alias_map, arg_aliases)
                 # calls that can create aliases such as B = A.ravel()
                 if isinstance(expr, ir.Expr) and expr.op == 'call':
                     fdef = guard(find_callname, func_ir, expr, typemap)
diff --git a/numba/numpy_support.py b/numba/numpy_support.py
index 819de27ef..d758e04ac 100644
--- a/numba/numpy_support.py
+++ b/numba/numpy_support.py
@@ -6,7 +6,7 @@ import re
 
 import numpy as np
 
-from . import errors, types, config, utils
+from . import errors, types, config, npdatetime, utils
 
 
 version = tuple(map(int, np.__version__.split('.')[:2]))
@@ -149,7 +149,6 @@ def as_dtype(nbtype):
     raise NotImplementedError("%r cannot be represented as a Numpy dtype"
                               % (nbtype,))
 
-
 def as_struct_dtype(rec):
     """Convert Numba Record type to NumPy structured dtype
     """
@@ -161,25 +160,8 @@ def as_struct_dtype(rec):
         'offsets': [rec.offset(k) for k in names],
         'itemsize': rec.size,
     }
-    _check_struct_alignment(rec, fields)
     return np.dtype(fields, align=rec.aligned)
 
-
-def _check_struct_alignment(rec, fields):
-    """Check alignment compatibility with Numpy"""
-    if rec.aligned:
-        for k, dt in zip(fields['names'], fields['formats']):
-            llvm_align = rec.alignof(k)
-            npy_align = dt.alignment
-            if llvm_align is not None and npy_align != llvm_align:
-                msg = (
-                    'NumPy is using a different alignment ({}) '
-                    'than Numba/LLVM ({}) for {}. '
-                    'This is likely a NumPy bug.'
-                )
-                raise ValueError(msg.format(npy_align, llvm_align, dt))
-
-
 def is_arrayscalar(val):
     return np.dtype(type(val)) in FROM_DTYPE
 
@@ -220,10 +202,12 @@ def select_array_wrapper(inputs):
     An index into *inputs* is returned.
     """
     max_prio = float('-inf')
+    selected_input = None
     selected_index = None
     for index, ty in enumerate(inputs):
         # Ties are broken by choosing the first winner, as in Numpy
         if isinstance(ty, types.ArrayCompatible) and ty.array_priority > max_prio:
+            selected_input = ty
             selected_index = index
             max_prio = ty.array_priority
 
@@ -283,7 +267,7 @@ def supported_ufunc_loop(ufunc, loop):
         supported_types = '?bBhHiIlLqQfd'
         # check if all the types involved in the ufunc loop are
         # supported in this mode
-        supported_loop = all(t in supported_types for t in loop_types)
+        supported_loop =  all(t in supported_types for t in loop_types)
 
     return supported_loop
 
@@ -461,7 +445,6 @@ def _get_bytes_buffer(ptr, nbytes):
     arrty = ctypes.c_byte * nbytes
     return arrty.from_address(ptr)
 
-
 def _get_array_from_ptr(ptr, nbytes, dtype):
     return np.frombuffer(_get_bytes_buffer(ptr, nbytes), dtype)
 
diff --git a/numba/pythonapi.py b/numba/pythonapi.py
index 571654061..29bc55ab1 100644
--- a/numba/pythonapi.py
+++ b/numba/pythonapi.py
@@ -1141,24 +1141,20 @@ class PythonAPI(object):
         if PYVERSION >= (3, 3):
             p_length = cgutils.alloca_once(self.builder, self.py_ssize_t)
             p_kind = cgutils.alloca_once(self.builder, Type.int())
-            p_ascii = cgutils.alloca_once(self.builder, Type.int())
             p_hash = cgutils.alloca_once(self.builder, self.py_hash_t)
             fnty = Type.function(self.cstring, [self.pyobj,
                                                 self.py_ssize_t.as_pointer(),
                                                 Type.int().as_pointer(),
-                                                Type.int().as_pointer(),
                                                 self.py_hash_t.as_pointer()])
             fname = "numba_extract_unicode"
             fn = self._get_function(fnty, name=fname)
 
-            buffer = self.builder.call(
-                fn, [strobj, p_length, p_kind, p_ascii, p_hash])
+            buffer = self.builder.call(fn, [strobj, p_length, p_kind, p_hash])
             ok = self.builder.icmp_unsigned('!=',
                                             ir.Constant(buffer.type, None),
                                             buffer)
             return (ok, buffer, self.builder.load(p_length),
-                    self.builder.load(p_kind), self.builder.load(p_ascii),
-                    self.builder.load(p_hash))
+                    self.builder.load(p_kind), self.builder.load(p_hash))
         else:
             assert False, 'not supported on Python < 3.3'
 
diff --git a/numba/targets/arraymath.py b/numba/targets/arraymath.py
index e833969d6..b5d96a9a8 100644
--- a/numba/targets/arraymath.py
+++ b/numba/targets/arraymath.py
@@ -2782,56 +2782,6 @@ def np_imag(a):
 #----------------------------------------------------------------------------
 # Misc functions
 
-np_delete_handler_isslice = register_jitable(lambda x : x)
-np_delete_handler_isarray = register_jitable(lambda x : np.asarray(x))
-
-@overload(np.delete)
-def np_delete(arr, obj):
-    # Implementation based on numpy
-    # https://github.com/numpy/numpy/blob/af66e487a57bfd4850f4306e3b85d1dac3c70412/numpy/lib/function_base.py#L4065-L4267
-
-    if not isinstance(arr, (types.Array, types.Sequence)):
-        raise TypingError("arr must be either an Array or a Sequence")
-
-    if isinstance(obj, (types.Array, types.Sequence, types.SliceType)):
-        if isinstance(obj, (types.SliceType)):
-            handler = np_delete_handler_isslice 
-        else:
-            if not isinstance(obj.dtype, types.Integer):
-                raise TypingError('obj should be of Integer dtype')
-            handler = np_delete_handler_isarray
-
-        def np_delete_impl(arr, obj):
-            arr = np.ravel(np.asarray(arr))
-            N = arr.size
-
-            keep = np.ones(N, dtype=np.bool_)
-            obj = handler(obj)
-            keep[obj] = False
-            return arr[keep]
-        return np_delete_impl
-
-    else: # scalar value
-        if not isinstance(obj, types.Integer):
-            raise TypingError('obj should be of Integer dtype')
-
-        def np_delete_scalar_impl(arr, obj):
-            arr = np.ravel(np.asarray(arr))
-            N = arr.size
-            pos = obj
-
-            if (pos < -N or pos >= N):
-                raise IndexError('obj must be less than the len(arr)')
-                # NumPy raises IndexError: index 'i' is out of
-                # bounds for axis 'x' with size 'n'
-
-            if (pos < 0):
-                pos += N
-
-            return np.concatenate((arr[:pos], arr[pos+1:]))
-        return np_delete_scalar_impl
-
-
 @overload(np.diff)
 def np_diff_impl(a, n=1):
     if not isinstance(a, types.Array) or a.ndim == 0:
diff --git a/numba/targets/linalg.py b/numba/targets/linalg.py
index 05180e7ee..6613c5e76 100644
--- a/numba/targets/linalg.py
+++ b/numba/targets/linalg.py
@@ -2377,43 +2377,46 @@ def cond_impl(a, p=None):
 
     _check_linalg_matrix(a, "cond")
 
-    def impl(a, p=None):
-        # This is extracted for performance, numpy does approximately:
-        # `condition = norm(a) * norm(inv(a))`
-        # in the cases of `p == 2` or `p ==-2` singular values are used
-        # for computing norms. This costs numpy an svd of `a` then an
-        # inversion of `a` and another svd of `a`.
-        # Below is a different approach, which also gives a more
-        # accurate answer as there is no inversion involved.
-        # Recall that the singular values of an inverted matrix are the
-        # reciprocal of singular values of the original matrix.
-        # Therefore calling `svd(a)` once yields all the information
-        # needed about both `a` and `inv(a)` without the cost or
-        # potential loss of accuracy incurred through inversion.
-        # For the case of `p == 2`, the result is just the ratio of
-        # `largest singular value/smallest singular value`, and for the
-        # case of `p==-2` the result is simply the
-        # `smallest singular value/largest singular value`.
-        # As a result of this, numba accepts non-square matrices as
-        # input when p==+/-2 as well as when p==None.
-        if p == 2 or p == -2 or p is None:
-            s = _compute_singular_values(a)
-            if p == 2 or p is None:
-                r = np.divide(s[0], s[-1])
-            else:
-                r = np.divide(s[-1], s[0])
-        else:  # cases np.inf, -np.inf, 1, -1
-            norm_a = np.linalg.norm(a, p)
-            norm_inv_a = np.linalg.norm(np.linalg.inv(a), p)
-            r = norm_a * norm_inv_a
-        # NumPy uses a NaN mask, if the input has a NaN, it will return NaN,
-        # Numba calls ban NaN through the use of _check_finite_matrix but this
-        # catches cases where NaN occurs through floating point use
-        if np.isnan(r):
-            return np.inf
+    def _get_cond_impl(a, p):
+        # handle the p==None case separately for type inference to work ok
+        if p in (None, types.none):
+            def cond_none_impl(a, p=None):
+                s = _compute_singular_values(a)
+                return s[0] / s[-1]
+            return cond_none_impl
         else:
-            return r
-    return impl
+            def cond_not_none_impl(a, p=None):
+                # This is extracted for performance, numpy does approximately:
+                # `condition = norm(a) * norm(inv(a))`
+                # in the cases of `p == 2` or `p ==-2` singular values are used
+                # for computing norms. This costs numpy an svd of `a` then an
+                # inversion of `a` and another svd of `a`.
+                # Below is a different approach, which also gives a more
+                # accurate answer as there is no inversion involved.
+                # Recall that the singular values of an inverted matrix are the
+                # reciprocal of singular values of the original matrix.
+                # Therefore calling `svd(a)` once yields all the information
+                # needed about both `a` and `inv(a)` without the cost or
+                # potential loss of accuracy incurred through inversion.
+                # For the case of `p == 2`, the result is just the ratio of
+                # `largest singular value/smallest singular value`, and for the
+                # case of `p==-2` the result is simply the
+                # `smallest singular value/largest singular value`.
+                # As a result of this, numba accepts non-square matrices as
+                # input when p==+/-2 as well as when p==None.
+                if p == 2 or p == -2:
+                    s = _compute_singular_values(a)
+                    if p == 2:
+                        return s[0] / s[-1]
+                    else:
+                        return s[-1] / s[0]
+                else:  # cases np.inf, -np.inf, 1, -1
+                    norm_a = np.linalg.norm(a, p)
+                    norm_inv_a = np.linalg.norm(np.linalg.inv(a), p)
+                    return norm_a * norm_inv_a
+            return cond_not_none_impl
+
+    return _get_cond_impl(a, p)
 
 
 @register_jitable
diff --git a/numba/types/containers.py b/numba/types/containers.py
index 0c9849520..d4d785c9f 100644
--- a/numba/types/containers.py
+++ b/numba/types/containers.py
@@ -359,6 +359,12 @@ class List(MutableSequence):
     def is_precise(self):
         return self.dtype.is_precise()
 
+    def __getitem__(self, args):
+        """
+        Overrides the default __getitem__ from Type.
+        """
+        return self.dtype
+
 
 class ListIter(BaseContainerIterator):
     """
diff --git a/numba/types/npytypes.py b/numba/types/npytypes.py
index e16addebc..805fe455d 100644
--- a/numba/types/npytypes.py
+++ b/numba/types/npytypes.py
@@ -44,7 +44,7 @@ class UnicodeCharSeq(Type):
         return self.count
 
 
-_RecordField = collections.namedtuple('_RecordField', 'type,offset,alignment')
+_RecordField = collections.namedtuple('_RecordField', 'type,offset')
 
 
 class Record(Type):
@@ -84,10 +84,8 @@ class Record(Type):
             # align
             misaligned = offset % align
             if misaligned:
-                offset += align - misaligned
-            fields.append((k, {
-                'type': ty, 'offset': offset, 'alignment': align,
-            }))
+                offset += size - misaligned
+            fields.append((k, {'type': ty, 'offset': offset}))
             offset += size
         # Adjust sizeof structure
         abi_size = ctx.get_abi_sizeof(ir.LiteralStructType(lltypes))
@@ -101,13 +99,9 @@ class Record(Type):
 
         # Create description
         descbuf = []
-        fmt = "{}[type={};offset={}{}]"
+        fmt = "{}[type={};offset={}]"
         for k, infos in fields:
-            if infos.alignment is not None:
-                extra = ';alignment={}'.format(infos.alignment)
-            else:
-                extra = ''
-            descbuf.append(fmt.format(k, infos.type, infos.offset, extra))
+            descbuf.append(fmt.format(k, infos.type, infos.offset))
 
         desc = ','.join(descbuf)
         name = 'Record({};{};{})'.format(desc, self.size, self.aligned)
@@ -117,15 +111,11 @@ class Record(Type):
     def _normalize_fields(cls, fields):
         """
         fields:
-            [name: str, { type: Type, offset: int, [ alignment: int ] }]
+            [name: str, { type: Type, offset: int }]
         """
         res = []
         for name, infos in sorted(fields, key=lambda x: (x[1]['offset'], x[0])):
-            fd = _RecordField(
-                type=infos['type'],
-                offset=infos['offset'],
-                alignment=infos.get('alignment'),
-            )
+            fd = _RecordField(type=infos['type'], offset=infos['offset'])
             res.append((name, fd))
         return res
 
@@ -154,13 +144,6 @@ class Record(Type):
         """
         return self.fields[key].type
 
-    def alignof(self, key):
-        """Get the specified alignment of the field.
-
-        Since field alignment is optional, this may return None.
-        """
-        return self.fields[key].alignment
-
     @property
     def members(self):
         """An ordered list of (name, type) for the fields.
diff --git a/numba/unicode.py b/numba/unicode.py
index 9e7cd6087..c472fa43e 100644
--- a/numba/unicode.py
+++ b/numba/unicode.py
@@ -31,7 +31,6 @@ from numba.targets import slicing
 from numba._helperlib import c_helpers
 from numba.targets.hashing import _Py_hash_t
 from numba.unsafe.bytes import memcpy_region
-from numba.errors import TypingError
 
 # DATA MODEL
 
@@ -43,7 +42,6 @@ class UnicodeModel(models.StructModel):
             ('data', types.voidptr),
             ('length', types.intp),
             ('kind', types.int32),
-            ('is_ascii', types.uint32),
             ('hash', _Py_hash_t),
             ('meminfo', types.MemInfoPointer(types.voidptr)),
             # A pointer to the owner python str/unicode object
@@ -55,7 +53,6 @@ class UnicodeModel(models.StructModel):
 make_attribute_wrapper(types.UnicodeType, 'data', '_data')
 make_attribute_wrapper(types.UnicodeType, 'length', '_length')
 make_attribute_wrapper(types.UnicodeType, 'kind', '_kind')
-make_attribute_wrapper(types.UnicodeType, 'is_ascii', '_is_ascii')
 make_attribute_wrapper(types.UnicodeType, 'hash', '_hash')
 
 
@@ -74,27 +71,25 @@ def compile_time_get_string_data(obj):
     the string data into the LLVM module.
     """
     from ctypes import (
-        CFUNCTYPE, c_void_p, c_int, c_uint, c_ssize_t, c_ubyte, py_object,
+        CFUNCTYPE, c_void_p, c_int, c_ssize_t, c_ubyte, py_object,
         POINTER, byref,
     )
 
     extract_unicode_fn = c_helpers['extract_unicode']
     proto = CFUNCTYPE(c_void_p, py_object, POINTER(c_ssize_t), POINTER(c_int),
-                      POINTER(c_uint), POINTER(c_ssize_t))
+                      POINTER(c_ssize_t))
     fn = proto(extract_unicode_fn)
     length = c_ssize_t()
     kind = c_int()
-    is_ascii = c_uint()
     hashv = c_ssize_t()
-    data = fn(obj, byref(length), byref(kind), byref(is_ascii), byref(hashv))
+    data = fn(obj, byref(length), byref(kind), byref(hashv))
     if data is None:
         raise ValueError("cannot extract unicode data from the given string")
     length = length.value
     kind = kind.value
-    is_ascii = is_ascii.value
     nbytes = (length + 1) * _kind_to_byte_width(kind)
     out = (c_ubyte * nbytes).from_address(data)
-    return bytes(out), length, kind, is_ascii, hashv.value
+    return bytes(out), length, kind, hashv.value
 
 
 def make_string_from_constant(context, builder, typ, literal_string):
@@ -102,7 +97,7 @@ def make_string_from_constant(context, builder, typ, literal_string):
     Get string data by `compile_time_get_string_data()` and return a
     unicode_type LLVM value
     """
-    databytes, length, kind, is_ascii, hashv = \
+    databytes, length, kind, hashv = \
         compile_time_get_string_data(literal_string)
     mod = builder.module
     gv = context.insert_const_bytes(mod, databytes)
@@ -110,7 +105,6 @@ def make_string_from_constant(context, builder, typ, literal_string):
     uni_str.data = gv
     uni_str.length = uni_str.length.type(length)
     uni_str.kind = uni_str.kind.type(kind)
-    uni_str.is_ascii = uni_str.is_ascii.type(is_ascii)
     uni_str.hash = uni_str.hash.type(hashv)
     return uni_str._getvalue()
 
@@ -137,13 +131,11 @@ def unbox_unicode_str(typ, obj, c):
     """
     Convert a unicode str object to a native unicode structure.
     """
-    ok, data, length, kind, is_ascii, hashv = \
-        c.pyapi.string_as_string_size_and_kind(obj)
+    ok, data, length, kind, hashv = c.pyapi.string_as_string_size_and_kind(obj)
     uni_str = cgutils.create_struct_proxy(typ)(c.context, c.builder)
     uni_str.data = data
     uni_str.length = length
     uni_str.kind = kind
-    uni_str.is_ascii = is_ascii
     uni_str.hash = hashv
     uni_str.meminfo = c.pyapi.nrt_meminfo_new_from_pyobject(
         data,  # the borrowed data pointer
@@ -203,13 +195,13 @@ def deref_uint32(typingctx, data, offset):
 
 
 @intrinsic
-def _malloc_string(typingctx, kind, char_bytes, length, is_ascii):
+def _malloc_string(typingctx, kind, char_bytes, length):
     """make empty string with data buffer of size alloc_bytes.
 
     Must set length and kind values for string after it is returned
     """
     def details(context, builder, signature, args):
-        [kind_val, char_bytes_val, length_val, is_ascii_val] = args
+        [kind_val, char_bytes_val, length_val] = args
 
         # fill the struct
         uni_str_ctor = cgutils.create_struct_proxy(types.unicode_type)
@@ -220,7 +212,6 @@ def _malloc_string(typingctx, kind, char_bytes, length, is_ascii):
                                              Constant(length_val.type, 1)))
         uni_str.meminfo = context.nrt.meminfo_alloc(builder, nbytes_val)
         uni_str.kind = kind_val
-        uni_str.is_ascii = is_ascii_val
         uni_str.length = length_val
         # empty string has hash value -1 to indicate "need to compute hash"
         uni_str.hash = context.get_constant(_Py_hash_t, -1)
@@ -229,14 +220,14 @@ def _malloc_string(typingctx, kind, char_bytes, length, is_ascii):
         uni_str.parent = cgutils.get_null_value(uni_str.parent.type)
         return uni_str._getvalue()
 
-    sig = types.unicode_type(types.int32, types.intp, types.intp, types.uint32)
+    sig = types.unicode_type(types.int32, types.intp, types.intp)
     return sig, details
 
 
 @njit
-def _empty_string(kind, length, is_ascii=0):
+def _empty_string(kind, length):
     char_width = _kind_to_byte_width(kind)
-    s = _malloc_string(kind, char_width, length, is_ascii)
+    s = _malloc_string(kind, char_width, length)
     _set_code_point(s, length, np.uint32(0))    # Write NULL character
     return s
 
@@ -325,13 +316,6 @@ def _pick_kind(kind1, kind2):
         raise AssertionError("Unexpected unicode representation in _pick_kind")
 
 
-@njit
-def _pick_ascii(is_ascii1, is_ascii2):
-    if is_ascii1 == 1 and is_ascii2 == 1:
-        return types.uint32(1)
-    return types.uint32(0)
-
-
 @njit
 def _kind_to_byte_width(kind):
     if kind == PY_UNICODE_1BYTE_KIND:
@@ -604,13 +588,11 @@ def join_list(sep, parts):
     sep_len = len(sep)
     length = (parts_len - 1) * sep_len
     kind = sep._kind
-    is_ascii = sep._is_ascii
     for p in parts:
         length += len(p)
         kind = _pick_kind(kind, p._kind)
-        is_ascii = _pick_ascii(is_ascii, p._is_ascii)
 
-    result = _empty_string(kind, length, is_ascii)
+    result = _empty_string(kind, length)
 
     # populate string
     part = parts[0]
@@ -648,31 +630,6 @@ def unicode_join(sep, parts):
         return join_str_impl
 
 
-@overload_method(types.UnicodeType, 'zfill')
-def unicode_zfill(string, width):
-    if not isinstance(width, types.Integer):
-        raise TypingError("<width> must be an Integer")
-
-    def zfill_impl(string, width):
-
-        str_len = len(string)
-
-        if width <= str_len:
-            return string
-
-        first_char = string[0] if str_len else ''
-        padding = '0' * (width - str_len)
-
-        if first_char in ['+', '-']:
-            newstr = first_char + padding + string[1:]
-        else:
-            newstr = padding + string
-
-        return newstr
-
-    return zfill_impl
-
-
 # String creation
 
 @njit
@@ -769,7 +726,6 @@ def _get_str_slice_view(typingctx, src_t, start_t, length_t):
             types.unicode_type)(context, builder)
         view_str.meminfo = in_str.meminfo
         view_str.kind = in_str.kind
-        view_str.is_ascii = in_str.is_ascii
         view_str.length = length
         # hash value -1 to indicate "need to compute hash"
         view_str.hash = context.get_constant(_Py_hash_t, -1)
@@ -798,7 +754,7 @@ def unicode_getitem(s, idx):
         if isinstance(idx, types.Integer):
             def getitem_char(s, idx):
                 idx = normalize_str_idx(idx, len(s))
-                ret = _empty_string(s._kind, 1, s._is_ascii)
+                ret = _empty_string(s._kind, 1)
                 _set_code_point(ret, 0, _get_code_point(s, idx))
                 return ret
             return getitem_char
@@ -810,7 +766,7 @@ def unicode_getitem(s, idx):
                 if slice_idx.step == 1:
                     return _get_str_slice_view(s, slice_idx.start, span)
                 else:
-                    ret = _empty_string(s._kind, span, s._is_ascii)
+                    ret = _empty_string(s._kind, span)
                     cur = slice_idx.start
                     for i in range(span):
                         _set_code_point(ret, i, _get_code_point(s, cur))
@@ -826,8 +782,7 @@ def unicode_concat(a, b):
         def concat_impl(a, b):
             new_length = a._length + b._length
             new_kind = _pick_kind(a._kind, b._kind)
-            new_ascii = _pick_ascii(a._is_ascii, b._is_ascii)
-            result = _empty_string(new_kind, new_length, new_ascii)
+            result = _empty_string(new_kind, new_length)
             for i in range(len(a)):
                 _set_code_point(result, i, _get_code_point(a, i))
             for j in range(len(b)):
@@ -845,7 +800,7 @@ def _repeat_impl(str_arg, mult_arg):
     else:
         new_length = str_arg._length * mult_arg
         new_kind = str_arg._kind
-        result = _empty_string(new_kind, new_length, str_arg._is_ascii)
+        result = _empty_string(new_kind, new_length)
         # make initial copy into result
         len_a = len(str_arg)
         _strncpy(result, 0, str_arg, 0, len_a)


Test patch:
diff --git a/numba/cuda/tests/cudapy/test_device_func.py b/numba/cuda/tests/cudapy/test_device_func.py
index b05a2b553..445fff6fd 100644
--- a/numba/cuda/tests/cudapy/test_device_func.py
+++ b/numba/cuda/tests/cudapy/test_device_func.py
@@ -7,7 +7,7 @@ import types
 import numpy as np
 
 from numba.cuda.testing import unittest, skip_on_cudasim, SerialMixin
-from numba import cuda, jit, int32
+from numba import cuda, jit
 from numba.errors import TypingError
 
 
@@ -109,40 +109,6 @@ class TestDeviceFunc(SerialMixin, unittest.TestCase):
         add_kernel[1, ary.size](ary)
         np.testing.assert_equal(expect, ary)
 
-    @skip_on_cudasim('not supported in cudasim')
-    def test_inspect_ptx(self):
-        @cuda.jit(device=True)
-        def foo(x, y):
-            return x + y
-
-        args = (int32, int32)
-        cres = foo.compile(args)
-
-        fname = cres.fndesc.mangled_name
-        # Verify that the function name has "foo" in it as in the python name
-        self.assertIn('foo', fname)
-
-        ptx = foo.inspect_ptx(args)
-        # Check that the compiled function name is in the PTX.
-        self.assertIn(fname, ptx.decode('ascii'))
-
-    @skip_on_cudasim('not supported in cudasim')
-    def test_inspect_llvm(self):
-        @cuda.jit(device=True)
-        def foo(x, y):
-            return x + y
-
-        args = (int32, int32)
-        cres = foo.compile(args)
-
-        fname = cres.fndesc.mangled_name
-        # Verify that the function name has "foo" in it as in the python name
-        self.assertIn('foo', fname)
-
-        llvm = foo.inspect_llvm(args)
-        # Check that the compiled function name is in the LLVM.
-        self.assertIn(fname, llvm)
-
 
 if __name__ == '__main__':
     unittest.main()
diff --git a/numba/tests/test_linalg.py b/numba/tests/test_linalg.py
index 5cccd8be7..a95a847a6 100644
--- a/numba/tests/test_linalg.py
+++ b/numba/tests/test_linalg.py
@@ -2052,16 +2052,6 @@ class TestLinalgCond(TestLinalgBase):
         for sz in [(0, 1), (1, 0), (0, 0)]:
             self.assert_raise_on_empty(cfunc, (np.empty(sz),))
 
-        # singular systems to trip divide-by-zero
-        # only for np > 1.14, before this norm was computed via inversion which
-        # will fail with numpy.linalg.linalg.LinAlgError: Singular matrix
-        if numpy_version > (1, 14):
-            x = np.array([[1, 0], [0, 0]], dtype=np.float64)
-            check(x)
-            check(x, p=2)
-            x = np.array([[0, 0], [0, 0]], dtype=np.float64)
-            check(x, p=-2)
-
         # try an ill-conditioned system with 2-norm, make sure np raises an
         # overflow warning as the result is `+inf` and that the result from
         # numba matches.
diff --git a/numba/tests/test_np_functions.py b/numba/tests/test_np_functions.py
index 5b86ec718..dd0b8b18a 100644
--- a/numba/tests/test_np_functions.py
+++ b/numba/tests/test_np_functions.py
@@ -32,10 +32,6 @@ def angle2(x, deg):
     return np.angle(x, deg)
 
 
-def delete(arr, obj):
-    return np.delete(arr, obj)
-
-
 def diff1(a):
     return np.diff(a)
 
@@ -346,69 +342,6 @@ class TestNPFunctions(MemoryLeakMixin, TestCase):
         x_types = [types.complex64, types.complex128]
         check(x_types, x_values)
 
-    def test_delete(self):
-
-        def arrays():
-            # array, obj
-            #
-            # an array-like type
-            yield [1, 2, 3, 4, 5], 3
-            yield [1, 2, 3, 4, 5], [2, 3]
-            # 1d array, scalar
-            yield np.arange(10), 3
-            yield np.arange(10), -3 # Negative obj
-            # 1d array, list
-            yield np.arange(10), [3, 5, 6]
-            yield np.arange(10), [2, 3, 4, 5]
-            # 3d array, scalar
-            yield np.arange(3 * 4 * 5).reshape(3, 4, 5), 2
-            # 3d array, list
-            yield np.arange(3 * 4 * 5).reshape(3, 4, 5), [5, 30, 27, 8]
-            # slices
-            yield [1, 2, 3, 4], slice(1, 3, 1)
-            yield np.arange(10), slice(10)
-
-        pyfunc = delete
-        cfunc = jit(nopython=True)(pyfunc)
-
-        for arr, obj in arrays():
-            expected = pyfunc(arr, obj)
-            got = cfunc(arr, obj)
-            self.assertPreciseEqual(expected, got)
-
-    def test_delete_exceptions(self):
-        pyfunc = delete
-        cfunc = jit(nopython=True)(pyfunc)
-        self.disable_leak_check()
-
-        with self.assertRaises(TypingError) as raises:
-            cfunc([1, 2], 3.14)
-        self.assertIn(
-            'obj should be of Integer dtype',
-            str(raises.exception)
-        )
-
-        with self.assertRaises(TypingError) as raises:
-            cfunc(np.arange(10), [3.5, 5.6, 6.2])
-        self.assertIn(
-            'obj should be of Integer dtype',
-            str(raises.exception)
-        )
-
-        with self.assertRaises(TypingError) as raises:
-            cfunc(2, 3)
-        self.assertIn(
-            'arr must be either an Array or a Sequence',
-            str(raises.exception)
-        )
-
-        with self.assertRaises(IndexError) as raises:
-            cfunc([1, 2], 3)
-        self.assertIn(
-            'obj must be less than the len(arr)',
-            str(raises.exception),
-        )
-
     def diff_arrays(self):
         """
         Some test arrays for np.diff()
diff --git a/numba/tests/test_numpy_support.py b/numba/tests/test_numpy_support.py
index ff4b6440a..989e7b6c7 100644
--- a/numba/tests/test_numpy_support.py
+++ b/numba/tests/test_numpy_support.py
@@ -10,7 +10,7 @@ from itertools import product
 import numpy as np
 
 import numba.unittest_support as unittest
-from numba import numpy_support, types
+from numba import config, numpy_support, types
 from .support import TestCase, tag
 from .enum_usecases import Shake, RequestError
 
@@ -121,20 +121,20 @@ class TestFromDtype(TestCase):
 
         dtype = np.dtype([('a', np.int16), ('b', np.int32)])
         check(dtype,
-              fields={'a': (types.int16, 0, None),
-                      'b': (types.int32, 2, None)},
+              fields={'a': (types.int16, 0),
+                      'b': (types.int32, 2)},
               size=6, aligned=False)
 
         dtype = np.dtype([('a', np.int16), ('b', np.int32)], align=True)
         check(dtype,
-              fields={'a': (types.int16, 0, None),
-                      'b': (types.int32, 4, None)},
+              fields={'a': (types.int16, 0),
+                      'b': (types.int32, 4)},
               size=8, aligned=True)
 
         dtype = np.dtype([('m', np.int32), ('n', 'S5')])
         check(dtype,
-              fields={'m': (types.int32, 0, None),
-                      'n': (types.CharSeq(5), 4, None)},
+              fields={'m': (types.int32, 0),
+                      'n': (types.CharSeq(5), 4)},
               size=9, aligned=False)
 
     @tag('important')
@@ -187,8 +187,7 @@ class ValueTypingTestBase(object):
         f = func
         for unit in [
             '', 'Y', 'M', 'D', 'h', 'm', 's',
-            'ms', 'us', 'ns', 'ps', 'fs', 'as',
-        ]:
+            'ms', 'us', 'ns', 'ps', 'fs', 'as']:
             if unit:
                 t = np_type(3, unit)
             else:
@@ -259,7 +258,6 @@ class FakeUFunc(object):
             assert len(in_) == self.nin
             assert len(out) == self.nout
 
-
 # Typical types for np.add, np.multiply, np.isnan
 _add_types = ['??->?', 'bb->b', 'BB->B', 'hh->h', 'HH->H', 'ii->i', 'II->I',
               'll->l', 'LL->L', 'qq->q', 'QQ->Q', 'ee->e', 'ff->f', 'dd->d',
diff --git a/numba/tests/test_parfors.py b/numba/tests/test_parfors.py
index 826cada8d..e7a53cb71 100644
--- a/numba/tests/test_parfors.py
+++ b/numba/tests/test_parfors.py
@@ -2085,29 +2085,6 @@ class TestPrange(TestPrangeBase):
             return B
         self.prange_tester(test_impl, 1.0)
 
-    @skip_unsupported
-    def test_argument_alias_recarray_field(self):
-        # Test for issue4007.
-        def test_impl(n):
-            for i in range(len(n)):
-                n.x[i] = 7.0
-            return n
-        X1 = np.zeros(10, dtype=[('x', float), ('y', int), ])
-        X2 = np.zeros(10, dtype=[('x', float), ('y', int), ])
-        X3 = np.zeros(10, dtype=[('x', float), ('y', int), ])
-        v1 = X1.view(np.recarray)
-        v2 = X2.view(np.recarray)
-        v3 = X3.view(np.recarray)
-
-        # Numpy doesn't seem to support almost equal on recarray.
-        # So, we convert to list and use assertEqual instead.
-        python_res = list(test_impl(v1))
-        njit_res = list(njit(test_impl)(v2))
-        pa_func = njit(test_impl, parallel=True)
-        pa_res = list(pa_func(v3))
-        self.assertEqual(python_res, njit_res)
-        self.assertEqual(python_res, pa_res)
-
     @skip_unsupported
     def test_mutable_list_param(self):
         """ issue3699: test that mutable variable to call in loop
diff --git a/numba/tests/test_record_dtype.py b/numba/tests/test_record_dtype.py
index b6e56b7c8..3e4f9adb7 100644
--- a/numba/tests/test_record_dtype.py
+++ b/numba/tests/test_record_dtype.py
@@ -9,76 +9,60 @@ from numba import unittest_support as unittest
 from numba.compiler import compile_isolated
 from numba.itanium_mangler import mangle_type
 from numba.utils import IS_PY3
-from numba.config import IS_WIN32
-from numba.numpy_support import version as numpy_version
 from .support import tag
 
 
 def get_a(ary, i):
     return ary[i].a
 
-
 def get_b(ary, i):
     return ary[i].b
 
-
 def get_c(ary, i):
     return ary[i].c
 
-
 def make_getitem(item):
     # This also exercises constant lookup from a closure variable
     def get_xx(ary, i):
         return ary[i][item]
     return get_xx
 
-
 # Issue #1664: constant index lookup should fall back to regular getitem
 def get_zero_a(ary, _unused):
     return ary[0].a
 
-
 getitem_a = make_getitem('a')
 getitem_b = make_getitem('b')
 getitem_c = make_getitem('c')
 
-
 def get_a_subarray(ary, i):
     return ary.a[i]
 
-
 def get_b_subarray(ary, i):
     return ary.b[i]
 
-
 def get_c_subarray(ary, i):
     return ary.c[i]
 
-
 def get_a_zero(ary, _unused):
     return ary.a[0]
 
-
 def make_getitem_subarray(item):
     # This also exercises constant lookup from a closure variable
     def get_xx_subarray(ary, i):
         return ary[item][i]
     return get_xx_subarray
 
-
 getitem_a_subarray = make_getitem_subarray('a')
 getitem_b_subarray = make_getitem_subarray('b')
 getitem_c_subarray = make_getitem_subarray('c')
 
-
 def get_two_arrays_a(ary1, ary2, i):
     return ary1[i].a + ary2[i].a
 
-
 def get_two_arrays_b(ary1, ary2, i):
     return ary1[i].b + ary2[i].b
 
-
 def get_two_arrays_c(ary1, ary2, i):
     return ary1[i].c + ary2[i].c
 
@@ -90,49 +74,39 @@ def get_two_arrays_distinct(ary1, ary2, i):
 def set_a(ary, i, v):
     ary[i].a = v
 
-
 def set_b(ary, i, v):
     ary[i].b = v
 
-
 def set_c(ary, i, v):
     ary[i].c = v
 
-
 def make_setitem(item):
     def set_xx(ary, i, v):
         ary[i][item] = v
     return set_xx
 
-
 setitem_a = make_setitem('a')
 setitem_b = make_setitem('b')
 setitem_c = make_setitem('c')
 
-
 def set_a_subarray(ary, i, v):
     ary.a[i] = v
 
-
 def set_b_subarray(ary, i, v):
     ary.b[i] = v
 
-
 def set_c_subarray(ary, i, v):
     ary.c[i] = v
 
-
 def make_setitem_subarray(item):
     def set_xx_subarray(ary, i, v):
         ary[item][i] = v
     return set_xx_subarray
 
-
 setitem_a_subarray = make_setitem('a')
 setitem_b_subarray = make_setitem('b')
 setitem_c_subarray = make_setitem('c')
 
-
 def set_record(ary, i, j):
     ary[i] = ary[j]
 
@@ -202,7 +176,6 @@ def record_write_array(ary):
     ary.h[0] = 3.0
     ary.h[1] = 4.0
 
-
 def record_write_2d_array(ary):
     ary.i = 3
     ary.j[0, 0] = 5.0
@@ -216,19 +189,15 @@ def record_write_2d_array(ary):
 def record_read_array0(ary):
     return ary.h[0]
 
-
 def record_read_array1(ary):
     return ary.h[1]
 
-
 def record_read_2d_array00(ary):
     return ary.j[0,0]
 
-
 def record_read_2d_array10(ary):
     return ary.j[1,0]
 
-
 def record_read_2d_array01(ary):
     return ary.j[0,1]
 
@@ -236,7 +205,6 @@ def record_read_2d_array01(ary):
 def record_read_first_arr(ary):
     return ary.k[2, 2]
 
-
 def record_read_second_arr(ary):
     return ary.l[2, 2]
 
@@ -325,49 +293,6 @@ class TestRecordDtypeMakeCStruct(unittest.TestCase):
         dtype = ty.dtype
         self.assertTrue(dtype.isalignedstruct)
 
-    def test_complex_struct(self):
-        class Complex(ctypes.Structure):
-            _fields_ = [
-                ('real', ctypes.c_double),
-                ('imag', ctypes.c_double),
-            ]
-
-        class Ref(ctypes.Structure):
-            _fields_ = [
-                ('apple', ctypes.c_int32),
-                ('mango', Complex),
-            ]
-
-        ty = types.Record.make_c_struct([
-            ('apple', types.intc),
-            ('mango', types.complex128),
-        ])
-        # Correct offsets
-        self.assertEqual(len(ty), 2)
-        self.assertEqual(ty.offset('apple'), Ref.apple.offset)
-        self.assertEqual(ty.offset('mango'), Ref.mango.offset)
-        # Correct size
-        self.assertEqual(ty.size, ctypes.sizeof(Ref))
-        # Is aligned?
-        # NumPy version < 1.16 misalign complex-128 types to 16bytes.
-        # (it seems to align on windows?!)
-        if numpy_version >= (1, 16) or IS_WIN32:
-            dtype = ty.dtype
-            self.assertTrue(dtype.isalignedstruct)
-        else:
-            with self.assertRaises(ValueError) as raises:
-                dtype = ty.dtype
-            # get numpy alignment
-            npalign = np.dtype(np.complex128).alignment
-            # llvm should align to wordsize
-            llalign = np.dtype(np.intp).alignment
-            self.assertIn(
-                ("NumPy is using a different alignment ({}) "
-                 "than Numba/LLVM ({}) for complex128. "
-                 "This is likely a NumPy bug.").format(npalign, llalign),
-                str(raises.exception),
-            )
-
 
 class TestRecordDtype(unittest.TestCase):
 
@@ -466,7 +391,7 @@ class TestRecordDtype(unittest.TestCase):
         cfunc = self.get_cfunc(pyfunc, (rec[:], rec[:], types.intp))
         for i in range(self.refsample1d.size):
             self.assertEqual(pyfunc(self.refsample1d, self.refsample1d3, i),
-                             cfunc(self.nbsample1d, self.nbsample1d3, i))
+                              cfunc(self.nbsample1d, self.nbsample1d3, i))
 
     def test_two_distinct_arrays(self):
         '''
@@ -563,7 +488,7 @@ class TestRecordDtype(unittest.TestCase):
         nbval = self.nbsample1d.copy()[0]
         attrs = 'abc'
         valtypes = types.float64, types.int16, types.complex64
-        values = 1.23, 12345, 123 + 456j
+        values = 1.23, 12345, 123+456j
         old_refcnt = sys.getrefcount(nbval)
 
         for attr, valtyp, val in zip(attrs, valtypes, values):
@@ -587,7 +512,7 @@ class TestRecordDtype(unittest.TestCase):
             got = cfunc(*args)
             try:
                 self.assertEqual(expected, got)
-            except AssertionError:
+            except AssertionError as e:
                 # On ARM, a LLVM misoptimization can produce buggy code,
                 # see https://llvm.org/bugs/show_bug.cgi?id=24669
                 import llvmlite.binding as ll
@@ -609,6 +534,7 @@ class TestRecordDtype(unittest.TestCase):
     def test_record_args_reverse(self):
         self._test_record_args(True)
 
+
     def test_two_records(self):
         '''
         Testing the use of two scalar records of the same type
@@ -630,6 +556,7 @@ class TestRecordDtype(unittest.TestCase):
             got = cfunc(nbval1, nbval2)
             self.assertEqual(expected, got)
 
+
     def test_two_distinct_records(self):
         '''
         Testing the use of two scalar records of differing type
@@ -645,6 +572,7 @@ class TestRecordDtype(unittest.TestCase):
         got = cfunc(nbval1, nbval2)
         self.assertEqual(expected, got)
 
+
     def test_record_write_array(self):
         '''
         Testing writing to a 1D array within a structured type
@@ -660,6 +588,7 @@ class TestRecordDtype(unittest.TestCase):
         expected[0].h[1] = 4.0
         np.testing.assert_equal(expected, nbval)
 
+
     @tag('important')
     def test_record_write_2d_array(self):
         '''
@@ -676,6 +605,7 @@ class TestRecordDtype(unittest.TestCase):
                                       np.float32).reshape(3, 2)
         np.testing.assert_equal(expected, nbval)
 
+
     def test_record_read_array(self):
         '''
         Test reading from a 1D array within a structured type
@@ -692,6 +622,7 @@ class TestRecordDtype(unittest.TestCase):
         res = cfunc(nbval[0])
         np.testing.assert_equal(res, nbval[0].h[1])
 
+
     @tag('important')
     def test_record_read_2d_array(self):
         '''
@@ -713,6 +644,7 @@ class TestRecordDtype(unittest.TestCase):
         res = cfunc(nbval[0])
         np.testing.assert_equal(res, nbval[0].j[1, 0])
 
+
     @tag('important')
     def test_record_return(self):
         """
@@ -851,7 +783,6 @@ class TestRecordDtypeWithStructArrays(TestRecordDtype):
         self.nbsample1d2 = np.zeros(3, dtype=recordtype2)
         self.nbsample1d3 = np.zeros(3, dtype=recordtype)
 
-
 class TestRecordDtypeWithStructArraysAndDispatcher(TestRecordDtypeWithStructArrays):
     '''
     Same as TestRecordDtypeWithStructArrays, stressing the Dispatcher's type
@@ -927,9 +858,9 @@ class TestRecordDtypeWithCharSeq(unittest.TestCase):
         cfunc = cres.entry_point
 
         for i in range(self.refsample1d.size):
-            chars = "{0}".format(hex(i + 10))
-            pyfunc(self.refsample1d, i, chars)
-            cfunc(self.nbsample1d, i, chars)
+            chars = "{0}".format(hex(i+10))
+            expected = pyfunc(self.refsample1d, i, chars)
+            got = cfunc(self.nbsample1d, i, chars)
             np.testing.assert_equal(self.refsample1d, self.nbsample1d)
 
     def test_py_argument_char_seq_near_overflow(self):
diff --git a/numba/tests/test_types.py b/numba/tests/test_types.py
index efef005b0..95fe0c96d 100644
--- a/numba/tests/test_types.py
+++ b/numba/tests/test_types.py
@@ -211,6 +211,12 @@ class TestTypes(TestCase):
         self.assertPreciseEqual(ty(5), np.timedelta64(5))
         self.assertPreciseEqual(ty('NaT'), np.timedelta64('NaT'))
 
+    def test_list_type_getitem(self):
+        for listty in (types.int64, types.Array(types.float64, 1, 'C')):
+            l_int = types.List(listty)
+            self.assertTrue(isinstance(l_int, types.List))
+            self.assertTrue(isinstance(l_int[0], type(listty)))
+
 
 class TestNumbers(TestCase):
     """
@@ -576,5 +582,6 @@ class TestDType(TestCase):
         jit_impl = jit(nopython=True)(impl)
         self.assertEqual(impl(), jit_impl())
 
+
 if __name__ == '__main__':
     unittest.main()
diff --git a/numba/tests/test_unicode.py b/numba/tests/test_unicode.py
index 4529d8305..124a20018 100644
--- a/numba/tests/test_unicode.py
+++ b/numba/tests/test_unicode.py
@@ -16,9 +16,6 @@ from numba.errors import TypingError
 _py34_or_later = sys.version_info[:2] >= (3, 4)
 
 
-isascii = lambda s: all(ord(c) < 128 for c in s)
-
-
 def literal_usecase():
     return '大处着眼，小处着手。'
 
@@ -39,10 +36,6 @@ def getitem_usecase(x, i):
     return x[i]
 
 
-def zfill_usecase(x, y):
-    return x.zfill(y)
-
-
 def concat_usecase(x, y):
     return x + y
 
@@ -364,37 +357,6 @@ class TestUnicode(BaseTest):
                                          cfunc(s, sl),
                                          "'%s'[%d:%d:%d]?" % (s, i, j, k))
 
-    def test_zfill(self):
-        pyfunc = zfill_usecase
-        cfunc = njit(pyfunc)
-
-        ZFILL_INPUTS = [
-            'ascii',
-            '+ascii',
-            '-ascii',
-            '-asc ii-',
-            '12345',
-            '-12345',
-            '+12345',
-            '',
-            '¡Y tú crs?',
-            '🐍⚡',
-            '+🐍⚡',
-            '-🐍⚡',
-            '大眼，小手。',
-            '+大眼，小手。',
-            '-大眼，小手。',
-        ]
-
-        with self.assertRaises(TypingError) as raises:
-            cfunc(ZFILL_INPUTS[0], 1.1)
-        self.assertIn('<width> must be an Integer', str(raises.exception))
-
-        for s in ZFILL_INPUTS:
-            for width in range(-3, 20):
-                self.assertEqual(pyfunc(s, width),
-                                 cfunc(s, width))
-
     def test_concat(self, flags=no_pyobj_flags):
         pyfunc = concat_usecase
         cfunc = njit(pyfunc)
@@ -761,53 +723,6 @@ class TestUnicodeInTuple(BaseTest):
 
         self.assertEqual(f.py_func(), f())
 
-    def test_ascii_flag_unbox(self):
-        @njit
-        def f(s):
-            return s._is_ascii
-
-        for s in UNICODE_EXAMPLES:
-            self.assertEqual(f(s), isascii(s))
-
-    def test_ascii_flag_join(self):
-        @njit
-        def f():
-            s1 = 'abc'
-            s2 = '123'
-            s3 = '🐍⚡'
-            s4 = '大处着眼，小处着手。'
-            return (",".join([s1, s2])._is_ascii,
-                    "🐍⚡".join([s1, s2])._is_ascii,
-                    ",".join([s1, s3])._is_ascii,
-                    ",".join([s3, s4])._is_ascii)
-
-        self.assertEqual(f(), (1, 0, 0, 0))
-
-    def test_ascii_flag_getitem(self):
-        @njit
-        def f():
-            s1 = 'abc123'
-            s2 = '🐍⚡🐍⚡🐍⚡'
-            return (s1[0]._is_ascii, s1[2:]._is_ascii, s2[0]._is_ascii,
-                    s2[2:]._is_ascii)
-
-        self.assertEqual(f(), (1, 1, 0, 0))
-
-    def test_ascii_flag_add_mul(self):
-        @njit
-        def f():
-            s1 = 'abc'
-            s2 = '123'
-            s3 = '🐍⚡'
-            s4 = '大处着眼，小处着手。'
-            return ((s1 + s2)._is_ascii,
-                    (s1 + s3)._is_ascii,
-                    (s3 + s4)._is_ascii,
-                    (s1 * 2)._is_ascii,
-                    (s3 * 2)._is_ascii)
-
-        self.assertEqual(f(), (1, 0, 0, 1, 0))
-
 
 @unittest.skipUnless(_py34_or_later,
                      'unicode support requires Python 3.4 or later')