diff options
author | Damien George <damien.p.george@gmail.com> | 2017-10-03 17:56:27 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-10-03 17:56:27 +1100 |
commit | 2ac1364688cd3ee313661e82a336663551986fc8 (patch) | |
tree | 4e69bc7e8d09cb3e4456275e7eba8fcffcd4de0c /tests/misc/non_compliant.py | |
parent | 01978648fdc317c13b17ba186c82df4fb8a5cbac (diff) |
py/objset: Check that RHS of a binary op is a set/frozenset.
CPython docs explicitly state that the RHS of a set/frozenset binary op
must be a set to prevent user errors. It also preserves commutativity of
the ops, eg: "abc" & set() is a TypeError, and so should be set() & "abc".
This change actually decreases unix (x64) code by 160 bytes; it increases
stm32 by 4 bytes and esp8266 by 28 bytes (but previous patch already
introduced a much large saving).
Diffstat (limited to 'tests/misc/non_compliant.py')
-rw-r--r-- | tests/misc/non_compliant.py | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py index b4c90e9fc..152633c3b 100644 --- a/tests/misc/non_compliant.py +++ b/tests/misc/non_compliant.py @@ -39,18 +39,6 @@ try: except NotImplementedError: print('NotImplementedError') -# should raise type error -try: - print(set('12') >= '1') -except TypeError: - print('TypeError') - -# should raise type error -try: - print(set('12') <= '123') -except TypeError: - print('TypeError') - # uPy raises TypeError, shold be ValueError try: '%c' % b'\x01\x02' |