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

more __contains__ tests #41596

Closed
jimjjewett mannequin opened this issue Feb 18, 2005 · 5 comments
Closed

more __contains__ tests #41596

jimjjewett mannequin opened this issue Feb 18, 2005 · 5 comments
Assignees
Labels
tests Tests in the Lib/test dir

Comments

@jimjjewett
Copy link
Mannequin

jimjjewett mannequin commented Feb 18, 2005

BPO 1141428
Nosy @birkenfeld, @birkenfeld, @rhettinger
Files
  • test_richcmp.diff
  • seq_tests.diff2: adding an in-order check to seq_tests
  • 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/birkenfeld'
    closed_at = <Date 2005-08-24.09:09:27.000>
    created_at = <Date 2005-02-18.00:42:23.000>
    labels = ['tests']
    title = 'more __contains__ tests'
    updated_at = <Date 2005-08-24.09:09:27.000>
    user = 'https://bugs.python.org/jimjjewett'

    bugs.python.org fields:

    activity = <Date 2005-08-24.09:09:27.000>
    actor = 'georg.brandl'
    assignee = 'georg.brandl'
    closed = True
    closed_date = None
    closer = None
    components = ['Tests']
    creation = <Date 2005-02-18.00:42:23.000>
    creator = 'jimjjewett'
    dependencies = []
    files = ['6504', '6505']
    hgrepos = []
    issue_num = 1141428
    keywords = ['patch']
    message_count = 5.0
    messages = ['47802', '47803', '47804', '47805', '47806']
    nosy_count = 5.0
    nosy_names = ['georg.brandl', 'georg.brandl', 'mcherm', 'rhettinger', 'jimjjewett']
    pr_nums = []
    priority = 'low'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1141428'
    versions = ['Python 2.5']

    @jimjjewett
    Copy link
    Mannequin Author

    jimjjewett mannequin commented Feb 18, 2005

    Recently, there was a change to speed up
    __contains__.

    x in (1, 2, 3) would be compiled as
    x in frozenset(1, 2, 3).

    This was backed out, because frozensets raise a
    typeerror when asked about unhashable objects.
    These objects *can't* be in the set, but there was
    concern about supporting objects in which a mutable
    and an immutable compare equal.

    So long as that is a requirement, it should be tested.

    The new test for sequences ensures that they will use
    __eq__ (and not rely on __hash__) in the future.

    The change to the rich compare tests is just a
    comment, pointing out that dicts can rely on
    __hash__ as well as __eq__.

    @jimjjewett jimjjewett mannequin closed this as completed Feb 18, 2005
    @jimjjewett jimjjewett mannequin assigned birkenfeld Feb 18, 2005
    @jimjjewett jimjjewett mannequin added the tests Tests in the Lib/test dir label Feb 18, 2005
    @jimjjewett jimjjewett mannequin closed this as completed Feb 18, 2005
    @jimjjewett jimjjewett mannequin assigned birkenfeld Feb 18, 2005
    @jimjjewett jimjjewett mannequin added the tests Tests in the Lib/test dir label Feb 18, 2005
    @mcherm
    Copy link
    Mannequin

    mcherm mannequin commented Feb 23, 2005

    Logged In: YES
    user_id=99874

    In the change to test_richcmp.diff, you should move the
    period to the end of the sentence.

    That being said, I'm +1 on applying this patch. I certainly
    agree that we should add the test since we care about
    preserving the behavior.

    @jimjjewett
    Copy link
    Mannequin Author

    jimjjewett mannequin commented Feb 25, 2005

    Logged In: YES
    user_id=764593

    Period moved, per mcherm's comment.

    @rhettinger
    Copy link
    Contributor

    Logged In: YES
    user_id=80475

    Check in for Py2.5 only.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=1188172

    Committed as test_richcmp.py r1.11 and seq_tests.py r1.5.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants