summaryrefslogtreecommitdiff
path: root/tests/unix/extra_coverage.py.exp
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-02-15 18:12:31 +1100
committerDamien George <damien.p.george@gmail.com>2018-02-19 16:12:44 +1100
commit165aab12a3918004325238c794e27e7f4adbb401 (patch)
tree1c878c7b42f6def14ceda55cb3115153c9ad31f2 /tests/unix/extra_coverage.py.exp
parent98647e83c733a8a8d36522f71e677367ca8ddd03 (diff)
py/repl: Generalise REPL autocomplete to use qstr probing.
This patch changes the way REPL autocomplete finds matches. It now probes the target object for all qstrs via mp_load_method_maybe to look for a match with the given input string. Similar to how the builtin dir() function works, this new algorithm now find all methods and instances of user-defined classes including attributes of their parent classes. This helps a lot at the REPL prompt for user-discovery and to autocomplete names even for classes that are derived. The downside is that this new algorithm is slower than the previous one, and in particular will be slower the more qstrs there are in the system. But because REPL autocomplete is primarily used in an interactive way it is not that important to make it fast, as long as it is "fast enough" compared to human reaction. On a slow microcontroller (CPU running at 16MHz) the autocomplete time for a list of 35 names in the outer namespace (pressing tab at a bare prompt) takes about 160ms with this algorithm, compared to about 40ms for the previous implementation (this time includes the actual printing of the names as well). This time of 160ms is very reasonable especially given the new functionality of listing all the names. This patch also decreases code size by: bare-arm: +0 minimal x86: -128 unix x64: -128 unix nanbox: -224 stm32: -88 cc3200: -80 esp8266: -92 esp32: -84
Diffstat (limited to 'tests/unix/extra_coverage.py.exp')
-rw-r--r--tests/unix/extra_coverage.py.exp10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp
index 26fd2e332..8a2c6aea9 100644
--- a/tests/unix/extra_coverage.py.exp
+++ b/tests/unix/extra_coverage.py.exp
@@ -24,11 +24,11 @@ RuntimeError:
# repl
ame__
-__name__ path argv version
-version_info implementation platform byteorder
-maxsize exit stdin stdout
-stderr modules exc_info getsizeof
-print_exception
+__class__ __name__ argv byteorder
+exc_info exit getsizeof implementation
+maxsize modules path platform
+print_exception stderr stdin
+stdout version version_info
ementation
# attrtuple
(start=1, stop=2, step=3)