My comments. http://codereview.appspot.com/953/diff/1/2 File numpy/core/tests/test_regression.py (right): http://codereview.appspot.com/953/diff/1/2#newcode5 Line 5: import os as _os Why are ...
15 years, 10 months ago
(2008-05-14 21:03:12 UTC)
#1
http://codereview.appspot.com/953/diff/1/2 File numpy/core/tests/test_regression.py (right): http://codereview.appspot.com/953/diff/1/2#newcode1033 Line 1033: filename = _os.path.join(__path__[0], "testdata_astype.pkl") On 2008/05/14 21:03:12, ondrej.certik ...
15 years, 10 months ago
(2008-05-14 22:19:26 UTC)
#4
http://codereview.appspot.com/953/diff/1/2
File numpy/core/tests/test_regression.py (right):
http://codereview.appspot.com/953/diff/1/2#newcode1033
Line 1033: filename = _os.path.join(__path__[0], "testdata_astype.pkl")
On 2008/05/14 21:03:12, ondrej.certik wrote:
> Just a question: "__path__" is just a local variable, right? Why not to name
it
> simply as "path"? Seems more natural to me. The "__path__" suggests something
> special to me.
From PEP8:
"""
__double_leading_and_trailing_underscore__: "magic" objects or attributes that
live in user-controlled namespaces. E.g. __init__, __import__ or __file__.
Never invent such names; only use them as documented.
"""
http://codereview.appspot.com/953/diff/1/2 File numpy/core/tests/test_regression.py (right): http://codereview.appspot.com/953/diff/1/2#newcode5 Line 5: import os as _os On 2008/05/14 21:03:12, ondrej.certik ...
15 years, 10 months ago
(2008-05-14 23:37:05 UTC)
#7
http://codereview.appspot.com/953/diff/1/2
File numpy/core/tests/test_regression.py (right):
http://codereview.appspot.com/953/diff/1/2#newcode5
Line 5: import os as _os
On 2008/05/14 21:03:12, ondrej.certik wrote:
> Why are you using "_os"? Why not just to use
>
> import os
>
> ?
I was blindly following the pattern in test_records. It seemed odd to me also,
but I thought maybe there was a reason, and it couldn't hurt. That's a very
weak excuse, I realize.
http://codereview.appspot.com/953/diff/1/2#newcode1033
Line 1033: filename = _os.path.join(__path__[0], "testdata_astype.pkl")
On 2008/05/14 22:19:27, Stefan wrote:
> On 2008/05/14 21:03:12, ondrej.certik wrote:
> > Just a question: "__path__" is just a local variable, right? Why not to name
> it
> > simply as "path"? Seems more natural to me. The "__path__" suggests
something
> > special to me.
>
> From PEP8:
>
> """
> __double_leading_and_trailing_underscore__: "magic" objects or attributes that
> live in user-controlled namespaces. E.g. __init__, __import__ or __file__.
> Never invent such names; only use them as documented.
> """
Agreed. Again, I was blindly following test_records.py instead of my natural
inclinations.
Issue 953: astype sometimes fails to return a copy
(Closed)
Created 15 years, 10 months ago by ondrej.certik
Modified 14 years, 7 months ago
Reviewers: stefanv, efiring
Base URL: http://svn.scipy.org/svn/numpy/trunk/
Comments: 7