MCPcopy Create free account
hub / github.com/ipython/ipython / test_ident

Function test_ident

tools/gen_latex_symbols.py:48–52  ·  view source on GitHub ↗

Is the unicode string valid in a Python 3 identifier.

(i)

Source from the content-addressed store, hash-verified

46print('Filtering out characters that are not valid Python 3 identifiers')
47
48def test_ident(i):
49 """Is the unicode string valid in a Python 3 identifier."""
50 # Some characters are not valid at the start of a name, but we still want to
51 # include them. So prefix with 'a', which is valid at the start.
52 return ('a' + i).isidentifier()
53
54assert test_ident("α")
55assert not test_ident('‴')

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected