New submission from Lorenz Quack: Example:
>>> completer = rlcompleter.Completer() >>> class A(object): ... def foo(): pass ... def foobar(): pass >>> completer.complete("A.foo(", 0) 'A.foo(' >>> completer.complete("A.foo(", 1) 'A.foobar(' I consider the last match a bug. The root of this bug is that in attr_matches the regular expression ignores any trailing non-alphanumeric characters by using the "\w" sequence. Note that it would also match "A.foo?%&@" to both "A.foo" and "A.foobar". I propose this regex instead: r"(\w+(\.\w+)*)\.([^.]*)" What do people think? ---------- components: Library (Lib) messages: 224848 nosy: donlorenzo priority: normal severity: normal status: open title: rlcompleter.Completer matches too much type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22141> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com