diff --git a/py/repl.c b/py/repl.c index da0fefb3a9..bb172d7a0e 100644 --- a/py/repl.c +++ b/py/repl.c @@ -187,6 +187,11 @@ size_t mp_repl_autocomplete(const char *str, size_t len, const mp_print_t *print if (s_len <= d_len && strncmp(s_start, d_str, s_len) == 0) { mp_load_method_protected(obj, q, dest, true); if (dest[0] != MP_OBJ_NULL) { + // special case; filter out words that begin with underscore + // unless there's already a partial match + if (s_len == 0 && *d_str == '_') { + continue; + } if (match_str == NULL) { match_str = d_str; match_len = d_len;