micropython/extmod
Damien George 5e34a113ea py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN.
Before this patch MP_BINARY_OP_IN had two meanings: coming from bytecode it
meant that the args needed to be swapped, but coming from within the
runtime meant that the args were already in the correct order.  This lead
to some confusion in the code and comments stating how args were reversed.
It also lead to 2 bugs: 1) containment for a subclass of a native type
didn't work; 2) the expression "{True} in True" would illegally succeed and
return True.  In both of these cases it was because the args to
MP_BINARY_OP_IN ended up being reversed twice.

To fix these things this patch introduces MP_BINARY_OP_CONTAINS which
corresponds exactly to the __contains__ special method, and this is the
operator that built-in types should implement.  MP_BINARY_OP_IN is now only
emitted by the compiler and is converted to MP_BINARY_OP_CONTAINS by
swapping the arguments.
2017-11-24 14:48:23 +11:00
..
crypto-algorithms extmod/crypto-algorithms/sha256: Remove non-standard memory.h header. 2017-04-27 15:01:01 +03:00
lwip-include all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
re1.5 extmod/re1.5: Upgrade to v0.8.2, adds hook for stack overflow checking. 2017-10-02 21:20:47 +03:00
uzlib extmod/uzlib: Update to upstream v2.1. 2016-10-11 07:13:23 +03:00
machine_i2c.c all: Convert remaining "mp_uint_t n_args" to "size_t n_args". 2017-08-30 10:59:58 +10:00
machine_i2c.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_mem.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
machine_mem.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
machine_pinbase.c extmod/machine_pinbase: Put PinBase singleton in ROM. 2017-09-12 16:00:21 +10:00
machine_pinbase.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_pulse.c extmod/machine_pulse: Make time_pulse_us() not throw exceptions. 2017-02-05 14:20:17 +03:00
machine_pulse.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_signal.c extmod/machine_signal: Fix parsing of invert arg when Pin is first arg. 2017-07-26 12:51:46 +10:00
machine_signal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
machine_spi.c extmod/machine_spi: Remove EVENT_POLL_HOOK from soft-SPI transfer func. 2017-02-06 14:38:33 +11:00
machine_spi.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
misc.h extmod/uos_dupterm: Update uos.dupterm() and helper funcs to have index. 2017-10-13 20:01:57 +11:00
modbtree.c py/runtime: Add MP_BINARY_OP_CONTAINS as reverse of MP_BINARY_OP_IN. 2017-11-24 14:48:23 +11:00
modframebuf.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modlwip.c all: Use NULL instead of "" when calling mp_raise exception helpers. 2017-10-24 22:39:36 +11:00
modonewire.c extmod/mod{lwip,onewire,webrepl}: Convert to mp_rom_map_elem_t. 2017-07-29 18:24:16 +03:00
modubinascii.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modubinascii.h all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
moductypes.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
moduhashlib.c extmod/moduhashlib: Enable SHA1 hashing when using "mbedtls" library. 2017-11-12 21:46:23 +02:00
moduheapq.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modujson.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
modurandom.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modure.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
moduselect.c all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
modussl_axtls.c extmod/modussl_axtls: Typo fix in comment. 2017-11-02 00:16:03 +02:00
modussl_mbedtls.c extmod/modussl_mbedtls: Allow to compile with unix coverage build. 2017-10-30 15:41:37 +11:00
modutimeq.c all: Use NULL instead of "" when calling mp_raise exception helpers. 2017-10-24 22:39:36 +11:00
moduzlib.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modwebrepl.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
modwebsocket.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
modwebsocket.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
uos_dupterm.c extmod/uos_dupterm: Swallow any errors from dupterm closing the stream. 2017-10-19 14:10:17 +11:00
utime_mphal.c py,extmod: Some casts and minor refactors to quiet compiler warnings. 2017-07-07 11:32:22 +10:00
utime_mphal.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs.c extmod/vfs: Use existing qstr for forward-slash string object. 2017-11-16 13:13:24 +11:00
vfs.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00
vfs_fat.c extmod/vfs_fat: Mount FatFS on creation so VFS methods can be used. 2017-11-20 11:46:40 +11:00
vfs_fat.h extmod/vfs_fat: Mount FatFS on creation so VFS methods can be used. 2017-11-20 11:46:40 +11:00
vfs_fat_diskio.c all: Use the name MicroPython consistently in comments 2017-07-31 18:35:40 +10:00
vfs_fat_file.c all: Remove inclusion of internal py header files. 2017-10-04 12:37:50 +11:00
vfs_fat_misc.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
vfs_reader.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
virtpin.c all: Rename mp_obj_type_t::stream_p to protocol. 2016-06-18 18:44:57 +03:00
virtpin.h all: Unify header guard usage. 2017-07-18 11:57:39 +10:00