<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/numpy.git/numpy/compat, branch maintenance/1.8.x</title>
<subtitle>github.com: numpy/numpy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/'/>
<entry>
<title>ENH: export py3k.integer_types from numpy.compat</title>
<updated>2013-09-08T02:51:19+00:00</updated>
<author>
<name>Christoph Gohlke</name>
<email>cgohlke@uci.edu</email>
</author>
<published>2013-09-08T01:59:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=883ddee033b69266170ac90af1926978bf489246'/>
<id>883ddee033b69266170ac90af1926978bf489246</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>STY: Giant comma spacing fixup.</title>
<updated>2013-08-18T17:51:25+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-08-18T17:51:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=fbd6510d58a47ea0d166c48a82793f05425406e4'/>
<id>fbd6510d58a47ea0d166c48a82793f05425406e4</id>
<content type='text'>
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply unicode fixer.</title>
<updated>2013-04-22T02:56:15+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-17T06:04:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=3a5c5475b5c2043dbe6791d3a5100a45d491546e'/>
<id>3a5c5475b5c2043dbe6791d3a5100a45d491546e</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply types fixer.</title>
<updated>2013-04-14T14:57:45+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-13T18:21:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=c879ad8a39f2b74edcdaa05a2f2f854fb235537d'/>
<id>c879ad8a39f2b74edcdaa05a2f2f854fb235537d</id>
<content type='text'>
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           &lt;- type(None)
    types.NotImplementedType &lt;- type(NotImplemented)
    types.EllipsisType       &lt;- type(Ellipsis)

The only two tricky substitutions are

    types.StringType         &lt;- bytes
    types.LongType           &lt;- 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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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           &lt;- type(None)
    types.NotImplementedType &lt;- type(NotImplemented)
    types.EllipsisType       &lt;- type(Ellipsis)

The only two tricky substitutions are

    types.StringType         &lt;- bytes
    types.LongType           &lt;- 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.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply basestring fixer.</title>
<updated>2013-04-13T15:05:31+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-13T15:05:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=68338eed3ae91c9846142e088c16b63635e58178'/>
<id>68338eed3ae91c9846142e088c16b63635e58178</id>
<content type='text'>
The basestring class is not defined in Python 3 and the fixer replaces
it with str. In order to have a common code base we define basestring in
numpy/compat/py3k.py to be str when the Python version is &gt;= 3,
otherwise basestring and import it where needed.  That works for most
cases, but there are a few files where the version dependent define
needs to be in the file.

Closes #3042.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The basestring class is not defined in Python 3 and the fixer replaces
it with str. In order to have a common code base we define basestring in
numpy/compat/py3k.py to be str when the Python version is &gt;= 3,
otherwise basestring and import it where needed.  That works for most
cases, but there are a few files where the version dependent define
needs to be in the file.

Closes #3042.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply the `numliterals` fixer and skip the `long` fixer.</title>
<updated>2013-04-13T13:43:56+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-11T20:31:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=7f5af37e26ba2e99ad3ee6928b78437f601e96e0'/>
<id>7f5af37e26ba2e99ad3ee6928b78437f601e96e0</id>
<content type='text'>
The numliterals fixer replaces the old style octal number like '01' by
'0o1' removes the 'L' suffix.

Octal values were previously mistakenly specified in some dates, those
uses have been corrected by removing the leading zeros.

Simply Removing the 'L' suffix should not be a problem, but in some
testing code it looks neccesary, so in those places the Python long
constructor is used instead.

The 'long' type is no longer defined in Python 3. Because we need to
have it defined for Python 2 it is added to numpy/compat/np3k.py where
it is defined as 'int' for Python 3 and 'long' for Python 2. The `long`
fixer then needs to be skipped so that it doesn't undo the good work.

Closes #3074, #3067.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The numliterals fixer replaces the old style octal number like '01' by
'0o1' removes the 'L' suffix.

Octal values were previously mistakenly specified in some dates, those
uses have been corrected by removing the leading zeros.

Simply Removing the 'L' suffix should not be a problem, but in some
testing code it looks neccesary, so in those places the Python long
constructor is used instead.

The 'long' type is no longer defined in Python 3. Because we need to
have it defined for Python 2 it is added to numpy/compat/np3k.py where
it is defined as 'int' for Python 3 and 'long' for Python 2. The `long`
fixer then needs to be skipped so that it doesn't undo the good work.

Closes #3074, #3067.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply `map` fixer.</title>
<updated>2013-04-10T22:41:13+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-09T18:44:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=a6164794a63215e23fa28432d9acec4727c68d02'/>
<id>a6164794a63215e23fa28432d9acec4727c68d02</id>
<content type='text'>
In Python 3 `map` is an iterator while in Python 2 it returns a list.
The simple fix applied by the fixer is to inclose all instances of map
with `list(...)`. This is not needed in all cases, and even where
appropriate list comprehensions may be preferred for their clarity.
Consequently, this patch attempts to use list comprehensions where it
makes sense.

When the mapped function has two arguments there is another problem that
can arise. In Python 3 map stops execution when the shortest argument
list is exhausted, while in Python 2 it stops when the longest argument
list is exhausted. Consequently the two argument case might need special
care. However, we have been running Python3 converted versions of numpy
since 1.5 without problems, so it is probably not something that affects
us.

Closes #3068
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Python 3 `map` is an iterator while in Python 2 it returns a list.
The simple fix applied by the fixer is to inclose all instances of map
with `list(...)`. This is not needed in all cases, and even where
appropriate list comprehensions may be preferred for their clarity.
Consequently, this patch attempts to use list comprehensions where it
makes sense.

When the mapped function has two arguments there is another problem that
can arise. In Python 3 map stops execution when the shortest argument
list is exhausted, while in Python 2 it stops when the longest argument
list is exhausted. Consequently the two argument case might need special
care. However, we have been running Python3 converted versions of numpy
since 1.5 without problems, so it is probably not something that affects
us.

Closes #3068
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Apply `print` fixer.</title>
<updated>2013-04-06T19:25:26+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-04-06T19:25:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=bb726ca19f434f5055c0efceefe48d89469fcbbe'/>
<id>bb726ca19f434f5055c0efceefe48d89469fcbbe</id>
<content type='text'>
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.

Closes #3078.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.

Closes #3078.
</pre>
</div>
</content>
</entry>
<entry>
<title>2to3: Use absolute imports.</title>
<updated>2013-03-28T14:43:26+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-03-28T03:49:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=d4b88c1dbd6898fb6fcebc97f36b421999340f71'/>
<id>d4b88c1dbd6898fb6fcebc97f36b421999340f71</id>
<content type='text'>
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.

1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:

    * all setup.py files
    * numpy/core/code_generators/generate_umath.py
    * numpy/core/code_generators/generate_numpy_api.py
    * numpy/core/code_generators/generate_ufunc_api.py

2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:

    * core/__init__.py,
    * core/numeric.py,
    * core/_internal.py,
    * core/arrayprint.py,
    * core/fromnumeric.py,
    * numpy/__init__.py,
    * lib/npyio.py,
    * lib/function_base.py,
    * fft/fftpack.py,
    * random/__init__.py

Closes #3172
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The new import `absolute_import` is added the `from __future__ import`
statement and The 2to3 `import` fixer is run to make the imports
compatible. There are several things that need to be dealt with to make
this work.

1) Files meant to be run as scripts run in a different environment than
files imported as part of a package, and so changes to those files need
to be skipped. The affected script files are:

    * all setup.py files
    * numpy/core/code_generators/generate_umath.py
    * numpy/core/code_generators/generate_numpy_api.py
    * numpy/core/code_generators/generate_ufunc_api.py

2) Some imported modules are not available as they are created during
the build process and consequently 2to3 is unable to handle them
correctly. Files that import those modules need a bit of extra work.
The affected files are:

    * core/__init__.py,
    * core/numeric.py,
    * core/_internal.py,
    * core/arrayprint.py,
    * core/fromnumeric.py,
    * numpy/__init__.py,
    * lib/npyio.py,
    * lib/function_base.py,
    * fft/fftpack.py,
    * random/__init__.py

Closes #3172
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge pull request #3026 from charris/2to3-fix-print</title>
<updated>2013-03-01T18:43:49+00:00</updated>
<author>
<name>Charles Harris</name>
<email>charlesr.harris@gmail.com</email>
</author>
<published>2013-03-01T18:43:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/numpy.git/commit/?id=d12dad4d42a4684d1e0a40c0105772ebab92d6bc'/>
<id>d12dad4d42a4684d1e0a40c0105772ebab92d6bc</id>
<content type='text'>
2to3: Put `from __future__ import division` in every python file.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
2to3: Put `from __future__ import division` in every python file.</pre>
</div>
</content>
</entry>
</feed>
