Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad584cb

Browse filesBrowse files
committed
Store compiled regex
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
1 parent eb499b8 commit ad584cb
Copy full SHA for ad584cb

1 file changed

+3-1Lines changed: 3 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎bpython/autocomplete.py‎

Copy file name to clipboardExpand all lines: bpython/autocomplete.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,16 @@ def safe_eval(expr, namespace):
297297
raise EvaluationError
298298

299299

300+
attr_matches_re = re.compile(r"(\w+(\.\w+)*)\.(\w*)")
301+
300302
def attr_matches(text, namespace, autocomplete_mode):
301303
"""Taken from rlcompleter.py and bent to my will.
302304
"""
303305

304306
# Gna, Py 2.6's rlcompleter searches for __call__ inside the
305307
# instance instead of the type, so we monkeypatch to prevent
306308
# side-effects (__getattr__/__getattribute__)
307-
m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
309+
m = attr_matches_re.match(text)
308310
if not m:
309311
return []
310312

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.