1. 14 Aug, 2021 3 commits
    • Jim Mussared's avatar
      extmod/modbluetooth: Add send_update arg to gatts_write. · 1d9e489a
      Jim Mussared authored
      This allows the write to trigger a notification or indication, but only to
      subscribed clients. This is different to gatts_notify/gatts_indicate,
      which will unconditionally notify/indicate.
      Signed-off-by: default avatarJim Mussared <jim.mussared@gmail.com>
      1d9e489a
    • Jim Mussared's avatar
    • Jim Mussared's avatar
      py: Implement partial PEP-498 (f-string) support. · 692d36d7
      Jim Mussared authored
      This implements (most of) the PEP-498 spec for f-strings and is based on
      https://github.com/micropython/micropython/pull/4998 by @klardotsh.
      
      It is implemented in the lexer as a syntax translation to `str.format`:
        f"{a}" --> "{}".format(a)
      
      It also supports:
        f"{a=}" --> "a={}".format(a)
      
      This is done by extracting the arguments into a temporary vstr buffer,
      then after the string has been tokenized, the lexer input queue is saved
      and the contents of the temporary vstr buffer are injected into the lexer
      instead.
      
      There are four main limitations:
      - raw f-strings (`fr` or `rf` prefixes) are not supported and will raise
        `SyntaxError: raw f-strings are not supported`.
      
      - literal concatenation of f-strings with adjacent strings will fail
          "{}" f"{a}" --> "{}{}".format(a)    (str.format will incorrectly use
                                               the braces from the non-f-string)
          f"{a}" f"{a}" --> "{}".format(a) "{}".format(a) (cannot concatenate)
      
      - PEP-498 requires the full parser to understand the interpolated
        argument, however because this entirely runs in the lexer it cannot
        resolve nested braces in expressions like
          f"{'}'}"
      
      - The !r, !s, and !a conversions are not supported.
      
      Includes tests and cpydiffs.
      Signed-off-by: default avatarJim Mussared <jim.mussared@gmail.com>
      692d36d7
  2. 13 Aug, 2021 13 commits
  3. 10 Aug, 2021 3 commits
  4. 09 Aug, 2021 3 commits
  5. 08 Aug, 2021 18 commits