[issue38327] Creating set with empty string returns empty set
New submission from Emil Bode : Initializing/creating a new set with an empty string via the set-command returns an empty set instead of set with the empty string. As in: While set('somestring') gives me a set of size one, set('') gives me an empty set (of size zero), just as set() would do It is possible to create a set with an empty string, as the command {''} and set(['']) work just as expected -- messages: 353585 nosy: EmilBode priority: normal severity: normal status: open title: Creating set with empty string returns empty set type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue38327> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38327] Creating set with empty string returns empty set
Emil Bode added the comment: Some details about my setup: Python 3.7.1, Spyder 3.3.2 IPython 7.2.0 under Windows 10 64-bit -- ___ Python tracker <https://bugs.python.org/issue38327> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38327] Creating set with empty string returns empty set
Emil Bode added the comment: You're right, I tested with set('a'), which gave me a set of size one, but generalized it here to 'somestring'. Maybe I'm just too loose with using set, instead of {} Sorry to bother you -- ___ Python tracker <https://bugs.python.org/issue38327> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40909] unittest assertCountEqual doesn't filter on values in dict
New submission from Emil Bode : Found as a comment on SO (https://stackoverflow.com/questions/12813633/how-to-assert-two-list-contain-the-same-elements-in-python#comment104082703_31832447): In unittest, `self.assertCountEqual({1: [1, 2, 3]}, {1: [5, 6, 7]})` succeeds, even though the two are different. In this simple case, using assertCountEqual is unnecessary, but there may be cases where a user wants to test for general equality regardless of order. Note that `self.assertCountEqual([{1: [1, 2, 3]}], [{1: [5, 6, 7]}])` (where both are a list, with only a dict-element), does fail. And comparing 2 dicts with different keys also fails as expected. -- components: Library (Lib) messages: 370973 nosy: EmilBode priority: normal severity: normal status: open title: unittest assertCountEqual doesn't filter on values in dict type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue40909> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com