2to3: Apply types fixer.

Python 3 removes the builtin types from the types module. The types
fixer replaces such references with the builtin types where possible
and also takes care of some special cases:

    types.TypeNone           <- type(None)
    types.NotImplementedType <- type(NotImplemented)
    types.EllipsisType       <- type(Ellipsis)

The only two tricky substitutions are

    types.StringType         <- bytes
    types.LongType           <- int

These are fixed up to support both Python 3 and Python 2 code by
importing the long and bytes types from numpy.compat.

Closes #3240.
bugfix in build_ext: check that ext has an attribute before trying to
use it
DOC: Change example to demonstrate function

"a * 0.5" example might as well be new_func(a) directly, it doesn't demonstrate the purpose of apply_along_axis().
Update masked array copy to preserve array order

Using 'K' to try to match array order, fixes https://github.com/numpy/numpy/issues/3156
Adding a test for #3265

Test to ensure that MaskedArray.filled() doesn't change the order of the array.

This test is a little messy because there are problems constructing an F-contiguous masked array in the first place. I had to explicitly pass in F-contiguous arrays for data and mask.
 reduces excess cleverness from 1/2 to 1/3
Merge pull request #3242 from charris/2to3-apply-types-fixer

2to3: Apply types fixer.
2to3: Apply unicode fixer.

The unicode fixer strips the u from u'hi' and converts the unicode type
to str. The first won't work for Python 2 and instead we replace the u
prefix with the sixu function borrowed from the six compatibility
package. That function calls the unicode constructor with the
'unicode_escape' encoder so that the many tests using escaped unicode
characters like u'\u0900' will be handled correctly. That makes the
sixu function a bit different from the asunicode function currently in
numpy.compat and also provides a target that can be converted back to
the u prefix when support for Python 3.2 is dropped. Python 3.3
reintroduced the u prefix for compatibility.

The unicode fixer also replaces 'unicode' with 'str' as 'unicode' is no
longer a builtin in Python 3. For code compatibility, 'unicode' is
defined either as 'str' or 'unicode' in numpy.compat so that checks like

    if isinstance(x, unicode):
        ...

will work properly for all python versions.

Closes #3089.
BUG: Fix typo in docscrape_sphinx.py import.
Merge pull request #3257 from charris/2to3-apply-unicode-fixer

2to3: Apply unicode fixer.
2to3: Stop using 2to3 and remove the tools/py3tool.py file.

The same code base now supports python versions 2.6-2.7 and 3.2-3.3.

Closes #3247.
DOC: Document that the 2to3 fixer is no longer used.
MAINT: Use from future_builtins zip and map.

For Python versions 2.6 and 2.7 the iterator forms of zip and map
can be imported from future_builtins. That is done here so as to
avoid using itertools.{izip, imap}.
ENH: remove obsolete ifort flags, ensure generated binaries work everywhere.
Merge pull request #3266 from charris/2to3-remove-2to3-fixer

2to3 remove 2to3 fixer
MAINT: Remove unneeded version checks.

Now that only Python versions 2.6-2.7 and 3.2-3.3 are supported
some version checks are no longer needed. This patch removes them
so as to clean up the code.
MAINT: Remove the tools/py3tool.py file.

The tools/py3tool.py file was responsible for running 2to3. Now that
2to3 is no longer run it is not needed and can be removed.
Fix for astype('S') string truncate issue

Calling astype('S') for an array of string objects results in a string array where dtype='S64', even if the original string objects are longer than 64 characters. Add call to GetParamsFromObject() to determine maximum string object length, and use that as string dtype size.
Merge pull request #3269 from charris/maint-remove-py3tool-file

MAINT: Remove the tools/py3tool.py file.
Merge pull request #3268 from charris/maint-remove-unneeded-version-checks

MAINT: Remove unneeded version checks.