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

memoryview not considered a sequence #62890

Closed
sfeltman mannequin opened this issue Aug 8, 2013 · 3 comments
Closed

memoryview not considered a sequence #62890

sfeltman mannequin opened this issue Aug 8, 2013 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@sfeltman
Copy link
Mannequin

sfeltman mannequin commented Aug 8, 2013

BPO 18690
Nosy @mdickinson, @ncoghlan, @skrah

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/ncoghlan'
closed_at = <Date 2013-10-02.12:32:17.277>
created_at = <Date 2013-08-08.20:38:26.041>
labels = ['type-feature', 'library']
title = 'memoryview not considered a sequence'
updated_at = <Date 2013-10-02.12:32:17.275>
user = 'https://bugs.python.org/sfeltman'

bugs.python.org fields:

activity = <Date 2013-10-02.12:32:17.275>
actor = 'python-dev'
assignee = 'ncoghlan'
closed = True
closed_date = <Date 2013-10-02.12:32:17.277>
closer = 'python-dev'
components = ['Library (Lib)']
creation = <Date 2013-08-08.20:38:26.041>
creator = 'sfeltman'
dependencies = []
files = []
hgrepos = []
issue_num = 18690
keywords = []
message_count = 3.0
messages = ['194707', '198830', '198831']
nosy_count = 5.0
nosy_names = ['mark.dickinson', 'ncoghlan', 'skrah', 'python-dev', 'sfeltman']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue18690'
versions = ['Python 3.4']

@sfeltman
Copy link
Mannequin Author

sfeltman mannequin commented Aug 8, 2013

This was a bit unexpected as memoryviews support all the methods of the Sequence abstract base class:

>>> import collections
>>> b = bytearray(b'asdf')
>>> isinstance(b, collections.Sequence)
True
>>> m = memoryview(b)
>>> isinstance(m, collections.Sequence)
False

It would be nice if memoryview was registered with the Sequence ABC and MutableSequence for writeable memoryviews.

@sfeltman sfeltman mannequin added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Aug 8, 2013
@pitrou pitrou added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Aug 9, 2013
@ncoghlan
Copy link
Contributor

ncoghlan commented Oct 2, 2013

There's no ducktyping for this due to the Sequence/Mapping confusion so it's a simple missing explicit registration.

@ncoghlan ncoghlan self-assigned this Oct 2, 2013
@python-dev
Copy link
Mannequin

python-dev mannequin commented Oct 2, 2013

New changeset 95badf936353 by Nick Coghlan in branch 'default':
Close bpo-18690: register memoryview with Sequence ABC
http://hg.python.org/cpython/rev/95badf936353

@python-dev python-dev mannequin closed this as completed Oct 2, 2013
@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
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants