<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/py/repl.c, branch 5.0.0-alpha.4</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-alpha.4</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=5.0.0-alpha.4'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2019-05-08T18:49:11+00:00</updated>
<entry>
<title>Merge pull request #1859 from scottbelden/tabbing</title>
<updated>2019-05-08T18:49:11+00:00</updated>
<author>
<name>Scott Shawcroft</name>
<email>scott@adafruit.com</email>
</author>
<published>2019-05-08T18:49:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=bec84f20abb716c0d8052554d841c1291ddf64cc'/>
<id>urn:sha1:bec84f20abb716c0d8052554d841c1291ddf64cc</id>
<content type='text'>
enter four spaces when there are no matches</content>
</entry>
<entry>
<title>enter four spaces when there are no matches</title>
<updated>2019-05-07T17:55:20+00:00</updated>
<author>
<name>scottbelden</name>
<email>scottabelden@gmail.com</email>
</author>
<published>2019-05-07T17:55:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=786cb40073dca41ae510093375e84ba41b7e9fb5'/>
<id>urn:sha1:786cb40073dca41ae510093375e84ba41b7e9fb5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix tests and clarify first character access</title>
<updated>2019-05-07T16:30:55+00:00</updated>
<author>
<name>Kathryn Lingel</name>
<email>kathryn@lingel.net</email>
</author>
<published>2019-05-07T16:30:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eb3cb4d99bc324d941e4fd32fd30c86ebf4c44e3'/>
<id>urn:sha1:eb3cb4d99bc324d941e4fd32fd30c86ebf4c44e3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Filter private methods from tab completion</title>
<updated>2019-05-06T19:16:29+00:00</updated>
<author>
<name>Kathryn Lingel</name>
<email>kathryn@lingel.net</email>
</author>
<published>2019-05-06T19:16:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=54aa1ce6deb1b2505b8ab2ce4c9ecc5899466b2d'/>
<id>urn:sha1:54aa1ce6deb1b2505b8ab2ce4c9ecc5899466b2d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py/repl: Fix handling of unmatched brackets and unfinished quotes.</title>
<updated>2018-05-18T05:23:02+00:00</updated>
<author>
<name>Li Weiwei</name>
<email>liweiwei@yeweitech.org</email>
</author>
<published>2018-05-18T03:15:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3e6ab82179f7b9a1df915f4bd0d6e48a454d942c'/>
<id>urn:sha1:3e6ab82179f7b9a1df915f4bd0d6e48a454d942c</id>
<content type='text'>
Before this patch:

    &gt;&gt;&gt; print(')
    ... ')
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1
    SyntaxError: invalid syntax

After this patch:

    &gt;&gt;&gt; print(')
    Traceback (most recent call last):
      File "&lt;stdin&gt;", line 1
    SyntaxError: invalid syntax

This matches CPython and prevents getting stuck in REPL continuation when a
1-quote is unmatched.
</content>
</entry>
<entry>
<title>py/repl: Initialise q_last variable to prevent compiler warnings.</title>
<updated>2018-05-11T03:48:47+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-11T03:48:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=6046e68fe19ca3e88e6e55438be9b2dee98723af'/>
<id>urn:sha1:6046e68fe19ca3e88e6e55438be9b2dee98723af</id>
<content type='text'>
Some older compilers cannot deduce that q_last is always written to before
being read.
</content>
</entry>
<entry>
<title>py/repl: Use mp_load_method_protected to prevent leaking of exceptions.</title>
<updated>2018-05-10T13:05:43+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-10T13:05:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=7241d90272f4dfe4100723393cc2f348f5d32c0a'/>
<id>urn:sha1:7241d90272f4dfe4100723393cc2f348f5d32c0a</id>
<content type='text'>
This patch fixes the possibility of a crash of the REPL when tab-completing
an object which raises an exception when its attributes are accessed.

See issue #3729.
</content>
</entry>
<entry>
<title>py/{modbuiltins,repl}: Start qstr probing from after empty qstr.</title>
<updated>2018-05-09T06:15:02+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-05-09T06:15:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=eb88803ac859db07726481501aea5c0e6bbf3705'/>
<id>urn:sha1:eb88803ac859db07726481501aea5c0e6bbf3705</id>
<content type='text'>
The list of qstrs starts with MP_QSTR_NULL followed by MP_QSTR_, and these
should never appear in dir() or REPL tab completion, so skip them.
</content>
</entry>
<entry>
<title>py/repl: Generalise REPL autocomplete to use qstr probing.</title>
<updated>2018-02-19T05:12:44+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2018-02-15T07:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=165aab12a3918004325238c794e27e7f4adbb401'/>
<id>urn:sha1:165aab12a3918004325238c794e27e7f4adbb401</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>all: Use the name MicroPython consistently in comments</title>
<updated>2017-07-31T08:35:40+00:00</updated>
<author>
<name>Alexander Steffen</name>
<email>devel.20.webmeister@spamgourmet.com</email>
</author>
<published>2017-06-30T07:22:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=55f33240f3d7051d4213629e92437a36f1fac50e'/>
<id>urn:sha1:55f33240f3d7051d4213629e92437a36f1fac50e</id>
<content type='text'>
There were several different spellings of MicroPython present in comments,
when there should be only one.
</content>
</entry>
</feed>
