Re: [Numpy-discussion] ndarray is not a sequence

2014-03-04 Thread Sturla Molden
Chris Barker chris.bar...@noaa.gov wrote: Sure -- but I'm afraid that there will be a lot of code that does an isinstance() check where it it absolutely unnecessary. If you really need to know if something is a sequence or a mapping, I suppose it's required, but how often is that? I must say

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-03 Thread Chris Barker
On Sat, Mar 1, 2014 at 6:09 PM, Alexander Belopolsky ndar...@mac.comwrote: On Fri, Feb 28, 2014 at 10:34 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Whatever happened to duck typing? http://legacy.python.org/dev/peps/pep-3119/#abcs-vs-duck-typing Sure -- but I'm afraid

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-02 Thread Sebastian Berg
On Fr, 2014-02-28 at 09:10 -0600, Anthony Scopatz wrote: Thanks All, I am sorry I missed the issue. (I still can't seem to find it, actually.) I agree that there would be minimal overhead here and I bet that would be easy to show. I really look forward to seeing this get in! Best

Re: [Numpy-discussion] ndarray is not a sequence

2014-03-01 Thread Alexander Belopolsky
On Fri, Feb 28, 2014 at 10:34 AM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: Whatever happened to duck typing? http://legacy.python.org/dev/peps/pep-3119/#abcs-vs-duck-typing ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Sturla Molden
Anthony Scopatz scop...@gmail.com wrote: Hello All, The semantics of this seem quite insane to me: In [1]: import numpy as np In [2]: import collections In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]: False In [6]: np.version.full_version Out[6]: '1.9.0.dev-eb40f65'

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Sebastian Berg
On Fr, 2014-02-28 at 08:47 +, Sturla Molden wrote: Anthony Scopatz scop...@gmail.com wrote: Hello All, The semantics of this seem quite insane to me: In [1]: import numpy as np In [2]: import collections In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]:

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Robert Kern
On Fri, Feb 28, 2014 at 9:03 AM, Sebastian Berg sebast...@sipsolutions.net wrote: On Fr, 2014-02-28 at 08:47 +, Sturla Molden wrote: Anthony Scopatz scop...@gmail.com wrote: Hello All, The semantics of this seem quite insane to me: In [1]: import numpy as np In [2]: import

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Robert Kern
On Fri, Feb 28, 2014 at 3:10 PM, Anthony Scopatz scop...@gmail.com wrote: Thanks All, I am sorry I missed the issue. (I still can't seem to find it, actually.) https://github.com/numpy/numpy/issues/2776 I agree that there would be minimal overhead here and I bet that would be easy to show.

Re: [Numpy-discussion] ndarray is not a sequence

2014-02-28 Thread Chris Barker - NOAA Federal
On Feb 28, 2014, at 1:04 AM, Sebastian Berg sebast...@sipsolutions.net wrote: because the sequence check like that seems standard in python 3. Whatever happened to duck typing? Sigh. -Chris ___ NumPy-Discussion mailing list

[Numpy-discussion] ndarray is not a sequence

2014-02-27 Thread Anthony Scopatz
Hello All, The semantics of this seem quite insane to me: In [1]: import numpy as np In [2]: import collections In [4]: isinstance(np.arange(5), collections.Sequence) Out[4]: False In [6]: np.version.full_version Out[6]: '1.9.0.dev-eb40f65' Is there any possibility that ndarray could inherit