Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport memoryview object to Python 2.7 #46648

Closed
teoliphant mannequin opened this issue Mar 18, 2008 · 11 comments
Closed

Backport memoryview object to Python 2.7 #46648

teoliphant mannequin opened this issue Mar 18, 2008 · 11 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@teoliphant
Copy link
Mannequin

teoliphant mannequin commented Mar 18, 2008

BPO 2396
Nosy @akuchling, @brettcannon, @theller, @pitrou, @benjaminp
Files
  • memview-trunk.patch
  • memview-trunk2.patch
  • memview-trunk3.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/pitrou'
    closed_at = <Date 2009-04-02.21:21:31.889>
    created_at = <Date 2008-03-18.16:02:42.942>
    labels = ['interpreter-core', 'type-feature']
    title = 'Backport memoryview object to Python 2.7'
    updated_at = <Date 2009-04-02.21:21:31.888>
    user = 'https://bugs.python.org/teoliphant'

    bugs.python.org fields:

    activity = <Date 2009-04-02.21:21:31.888>
    actor = 'pitrou'
    assignee = 'pitrou'
    closed = True
    closed_date = <Date 2009-04-02.21:21:31.889>
    closer = 'pitrou'
    components = ['Interpreter Core']
    creation = <Date 2008-03-18.16:02:42.942>
    creator = 'teoliphant'
    dependencies = []
    files = ['12676', '12679', '13325']
    hgrepos = []
    issue_num = 2396
    keywords = ['patch']
    message_count = 11.0
    messages = ['63930', '70648', '70710', '70711', '70738', '70741', '79559', '79570', '82585', '83540', '85267']
    nosy_count = 6.0
    nosy_names = ['akuchling', 'brett.cannon', 'theller', 'teoliphant', 'pitrou', 'benjamin.peterson']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue2396'
    versions = ['Python 2.7']

    @teoliphant
    Copy link
    Mannequin Author

    teoliphant mannequin commented Mar 18, 2008

    The memoryview object in Python 2.6 would help in the transition to
    Python 3.0. It is a lower-priority and could wait until 2.7 if it
    doesn't get finished.

    @teoliphant teoliphant mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement labels Mar 18, 2008
    @brettcannon
    Copy link
    Member

    But the warning in 2.6 for buffer() says to use memoryview(), which does
    not exist. So either the backport needs to happen in 2.6 or the warning
    needs to go away for generic buffer() usage and instead be changed to
    only occur when the 2to3 fixer won't work (which, I am guessing, is only
    needed when more than one argument to buffer() is used).

    @akuchling
    Copy link
    Member

    Is there still time to do the backport for 2.6 at this late date?

    @pitrou
    Copy link
    Member

    pitrou commented Aug 4, 2008

    Not only there may not be enough time, but:

    1. the memoryview implementation itself is not finished (that is, in py3k)
    2. polishing and documenting the buffer API is more important
    3. there doesn't seem to be any use for memoryview objects right now

    So, IMO, this can be re-targeted to 2.7.

    @benjaminp
    Copy link
    Contributor

    I concur.

    @pitrou
    Copy link
    Member

    pitrou commented Aug 5, 2008

    Not a release blocker then :-)

    @pitrou
    Copy link
    Member

    pitrou commented Jan 10, 2009

    Here is a patch. Some remarks:

    • I had to disable a few tests in test_memoryview.py, mainly because
      array.array does not support the new buffer API in 2.x
    • I kept the PyBytes_* aliases in memoryobject.c rather than using the
      PyString_* equivalents. Is it ok?
    • I didn't update the Windows build files, I suppose someone else can do
      it (I'm unable to do it myself)
    • I'm not sure about the tp_flags juggling in typeobject.c, my additions
      may be redundant (although very lightweight)

    @pitrou pitrou changed the title Backport memoryview object to Python 2.6 Backport memoryview object to Python 2.7 Jan 10, 2009
    @pitrou pitrou self-assigned this Jan 10, 2009
    @pitrou
    Copy link
    Member

    pitrou commented Jan 10, 2009

    This new patch includes documentation update and fixes as well.

    @benjaminp
    Copy link
    Contributor

    Some comments:

    • PyBytes_* API is fine.
    • memory_str should die.
    • Py_TPFLAGS_HAVE_NEWBUFFER needs to be documented.

    Otherwise it looks good.

    @pitrou
    Copy link
    Member

    pitrou commented Mar 13, 2009

    Here is an updated patch removing memory_str.
    I know Py_TPFLAGS_HAVE_NEWBUFFER should be documented, but I'm not sure
    where and how (I didn't add it in the first place).

    @pitrou
    Copy link
    Member

    pitrou commented Apr 2, 2009

    Committed in r71070.

    @pitrou pitrou closed this as completed Apr 2, 2009
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants