Mailing List Archive

[issue43029] unittest: Add assertUniqeIn
New submission from Denis Roussel <roussel2nis@gmail.com>:

Allows to test uniqueness of members of a list

----------
components: Tests
messages: 385700
nosy: rousseldenis
priority: normal
severity: normal
status: open
title: unittest: Add assertUniqeIn

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Change by Denis Roussel <roussel2nis@gmail.com>:


----------
keywords: +patch
pull_requests: +23154
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24336

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Raymond Hettinger <raymond.hettinger@gmail.com> added the comment:

-0 on this one because the algorithm is quadratic, the name is opaque, and because the common case can already be clearly expressed with sets.

----------
nosy: +rhettinger

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

It looks pretty niche. I do not remember a single case in which such method would help.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Denis Roussel <roussel2nis@gmail.com> added the comment:

Indeed, can do
assertNotEquals(len(the_list), len(set(the_list))

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Terry J. Reedy <tjreedy@udel.edu> added the comment:

I think you meant assertEqual(len(alist), len(set(alist))). I agree with others.

----------
nosy: +terry.reedy
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
type: -> enhancement
versions: +Python 3.10

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue43029] unittest: Add assertUniqeIn [ In reply to ]
Denis Roussel <roussel2nis@gmail.com> added the comment:

Of course. Wanted a shortcut. Can close it if you want.

----------

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue43029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com