http://codereview.appspot.com/1105/diff/1/3 File numpy/lib/function_base.py (right): http://codereview.appspot.com/1105/diff/1/3#newcode569 Line 569: condlist = [asarray(c,dtype=bool) for c in condlist] On ...
15 years, 11 months ago
(2008-05-21 10:24:25 UTC)
#2
http://codereview.appspot.com/1105/diff/1/3
File numpy/lib/function_base.py (right):
http://codereview.appspot.com/1105/diff/1/3#newcode569
Line 569: condlist = [asarray(c,dtype=bool) for c in condlist]
On 2008/05/21 09:51:53, ondrej.certik wrote:
> Puristic comment -- I'd use:
>
> asarray(c, dtype=bool)
>
> instead of:
>
> asarray(c,dtype=bool)
Done.
http://codereview.appspot.com/1105/diff/1/2
File numpy/lib/tests/test_function_base.py (right):
http://codereview.appspot.com/1105/diff/1/2#newcode654
Line 654:
On 2008/05/21 09:51:53, ondrej.certik wrote:
> This is maybe puristic, but I think the standard is to use more whitespace,
i.e.
> this:
>
> x = piecewise([1, 2], [True, False], [2, 3])
>
> instead of this:
>
> x = piecewise([1,2],[True,False],[2,3])
>
> but I can see that there is not a consistency in this file.
Done.
http://codereview.appspot.com/1105/diff/22/122 File numpy/lib/function_base.py (right): http://codereview.appspot.com/1105/diff/22/122#newcode566 Line 566: if not (isinstance(condlist[0], types.ListType) or types.ListType is unnecessary. ...
15 years, 11 months ago
(2008-05-21 20:10:27 UTC)
#4
Updated to use `tuple` instead of `types.TupleType`. Also fixed some other occurrences, like `types.StringType`. http://codereview.appspot.com/1105/diff/22/122 ...
15 years, 11 months ago
(2008-05-21 20:18:17 UTC)
#5
Updated to use `tuple` instead of `types.TupleType`. Also fixed some other
occurrences, like `types.StringType`.
http://codereview.appspot.com/1105/diff/22/122
File numpy/lib/function_base.py (right):
http://codereview.appspot.com/1105/diff/22/122#newcode566
Line 566: if not (isinstance(condlist[0], types.ListType) or
On 2008/05/21 20:10:28, Robert Kern wrote:
> types.ListType is unnecessary. list itself is the type.
Well spotted, thank you.
Issue 1105: `piecewise` exposes raw memory
(Closed)
Created 15 years, 11 months ago by stefanv
Modified 14 years, 9 months ago
Reviewers: ondrej.certik, Robert Kern
Base URL: http://svn.scipy.org/svn/numpy/trunk/
Comments: 6