Skip to content

Consider using Lib/test/list_tests.py to test collections.deque #138585

@larryhastings

Description

@larryhastings

Feature or enhancement

Bug description:

collections.deque is a list-like object that supports fast insertion and removal of elements at either the beginning or the end. Although it doesn't state this goal explicitly, I believe it's intended to be a drop-in replacement for list.

Lib/test/list_tests.py is a file containing unit tests for list-like objects. It's designed to be used with any arbitrary list-like object. However, currently collections.deque doesn't test against it.

I assume the collections.deque object is working fine, and testing it against Lib/test/list_tests.py wouldn't uncover anything. Still, I think more tests are always a good thing. So I propose to incorporate list_tests.py into the deque test suite. It would only be a small amount of work, and who knows, the tests might discover something someday.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions