memoryview (was "len() on mutables vs. immutables")

Discussion in 'Python' started by Demian Brecht, Feb 8, 2013.

  1. On 2013-02-07 8:30 PM, "Terry Reedy" <> wrote:
    >So you may assume


    I've been bitten far too many times by incorrect assumptions about
    implementations that ended up actually doing something quite silly. Having
    said that, I felt fairly safe in making that assumption with Python, but
    figured I'd write something about my findings as I dug around the source
    in order to answer the question for myself.

    Still wondering about memoryview though:

    If a memoryview (3+) is representing a non-continuguous block of memory (>
    1
    ndim), will len(obj) not return incorrect results? It seems to be
    reporting the shape of the 0th dim at the moment.. Or is there something
    that I'm missing altogether?
     
    Demian Brecht, Feb 8, 2013
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Phlip

    attach cString to memoryview?

    Phlip, Aug 3, 2011, in forum: Python
    Replies:
    1
    Views:
    324
    Peter Otten
    Aug 3, 2011
  2. Demian Brecht

    len() on mutables vs. immutables

    Demian Brecht, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    197
    Demian Brecht
    Oct 18, 2012
  3. Frank Millman
    Replies:
    0
    Views:
    227
    Frank Millman
    Jul 31, 2013
  4. Frank Millman
    Replies:
    2
    Views:
    205
    Frank Millman
    Aug 1, 2013
Loading...