• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

davidhalter / parso / 505
89%

Build:
DEFAULT BRANCH: master
Ran 22 Nov 2020 12:39PM UTC
Jobs 1
Files 21
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
505

push

travis-ci

web-flow
Support named unicode characters in f-strings (#160)

* Support named unicode characters in f-strings

Fixes #154

The previous behavior misinterpreted the curly braces as enclosing an
expression.  This change does some cursory validation so we can still
get parse errors in the most egregious cases, but does not validate that
the names are actually valid, only that they are name-shaped and have a
chance of being valid.

The character names appear to obey a few rules:
* Case insensitive
* Name characters are `[A-Z0-9 \-]`
* Whitespace before or after is not allowed
* Whitespace in the middle may only be a single space between words
* Dashes may occur at the start or middle of a word

```py
f"\N{A B}"           # might be legal
f"\N{a b}"           # equivalent to above
f"\N{A     B}"       # no way
f"\N{    A B     }"  # no way
f"""\N{A
B}"""                # no way
```

For confirming this regex matches all (current) unicode character names:

```py
import re
import sys
import unicodedata

R = re.compile(r"[A-Za-z0-9\-]+(?: [A-Za-z0-9\-]+)*")

for i in range(sys.maxunicode):
    try:
        name = unicodedata.name(chr(i))
    except ValueError:
        # Some small values like 0 and 1 have no name, /shrug
        continue
    m = R.fullmatch(name)
    if m is None:
        print("FAIL", repr(name))
```

* Improve tests for named unicode escapes

3 of 3 new or added lines in 1 file covered. (100.0%)

3666 of 4118 relevant lines covered (89.02%)

0.89 hits per line

Jobs
ID Job ID Ran Files Coverage
5 505.5 22 Nov 2020 12:39PM UTC 0
89.02
Travis Job 505.5
Source Files on build 505
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #505
  • d39aadc4 on github
  • Prev Build on master (#502)
  • Next Build on master (#509)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc