File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1614,14 +1614,11 @@ STATIC void emit_native_store_subscr(emit_t *emit) {
16141614}
16151615
16161616STATIC void emit_native_delete_fast (emit_t * emit , qstr qst , mp_uint_t local_num ) {
1617- // TODO implement me!
1618- // could support for Python types, just set to None (so GC can reclaim it)
1619- // local is automatically deleted for exception block "as" var, and the message
1620- // breaks tests.
1621- //mp_emitter_warning(emit->pass, "Native codegeneration doesn't support deleting local");
1622- (void )emit ;
1623- (void )qst ;
1624- (void )local_num ;
1617+ // TODO: This is not compliant implementation. We could use MP_OBJ_SENTINEL
1618+ // to mark deleted vars but then every var would need to be checked on
1619+ // each access. Very inefficient, so just set value to None to enable GC.
1620+ emit_native_load_const_tok (emit , MP_TOKEN_KW_NONE );
1621+ emit_native_store_fast (emit , qst , local_num );
16251622}
16261623
16271624STATIC void emit_native_delete_deref (emit_t * emit , qstr qst , mp_uint_t local_num ) {
You can’t perform that action at this time.
0 commit comments