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

Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays #56840

Closed
py-user mannequin opened this issue Jul 25, 2011 · 2 comments
Closed
Labels
docs Documentation in the Doc dir interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@py-user
Copy link
Mannequin

py-user mannequin commented Jul 25, 2011

BPO 12631
Nosy @py-user, @akheron
Superseder
  • bpo-12170: index() and count() methods of bytes and bytearray should accept byte ints
  • 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 = None
    closed_at = <Date 2011-08-01.06:46:31.475>
    created_at = <Date 2011-07-25.00:26:29.517>
    labels = ['interpreter-core', 'type-bug', 'docs']
    title = 'Mutable Sequence Type in .remove() is consistent only with lists, but not with bytearrays'
    updated_at = <Date 2011-08-01.06:46:31.474>
    user = 'https://github.com/py-user'

    bugs.python.org fields:

    activity = <Date 2011-08-01.06:46:31.474>
    actor = 'petri.lehtinen'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2011-08-01.06:46:31.475>
    closer = 'petri.lehtinen'
    components = ['Documentation', 'Interpreter Core']
    creation = <Date 2011-07-25.00:26:29.517>
    creator = 'py.user'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 12631
    keywords = []
    message_count = 2.0
    messages = ['141066', '141218']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'py.user', 'petri.lehtinen']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = '12170'
    type = 'behavior'
    url = 'https://bugs.python.org/issue12631'
    versions = ['Python 3.1']

    @py-user
    Copy link
    Mannequin Author

    py-user mannequin commented Jul 25, 2011

    4.6.4 Mutable Sequence Types

    | s.remove(x) | same as del s[s.index(x)] |

    >>> b = bytearray()
    >>> b.extend(range(1, 6))
    >>> b
    bytearray(b'\x01\x02\x03\x04\x05')
    >>> b.remove(2)
    >>> del b[b.index(2)]
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: Type int doesn't support the buffer API
    >>>

    @py-user py-user mannequin assigned docspython Jul 25, 2011
    @py-user py-user mannequin added docs Documentation in the Doc dir interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jul 25, 2011
    @akheron
    Copy link
    Member

    akheron commented Jul 27, 2011

    Duplicate of bpo-12170.

    @akheron akheron closed this as completed Aug 1, 2011
    @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
    docs Documentation in the Doc dir interpreter-core Interpreter core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant