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

Method fwd_unicode_match

IPython/core/completer.py:2071–2092  ·  view source on GitHub ↗
(self, text:str)

Source from the content-addressed store, hash-verified

2069 return text, _matches, origins, completions
2070
2071 def fwd_unicode_match(self, text:str) -> Tuple[str, list]:
2072 if self._names is None:
2073 self._names = []
2074 for c in range(0,0x10FFFF + 1):
2075 try:
2076 self._names.append(unicodedata.name(chr(c)))
2077 except ValueError:
2078 pass
2079
2080 slashpos = text.rfind('\\')
2081 # if text starts with slash
2082 if slashpos > -1:
2083 s = text[slashpos+1:]
2084 candidates = [x for x in self._names if x.startswith(s)]
2085 if candidates:
2086 return s, candidates
2087 else:
2088 return '', ()
2089
2090 # if text does not start with slash
2091 else:
2092 return u'', ()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected