Martin v. Löwis added the comment: Two observations: 1. This issue is only about identifiers. So processing of string literals is technically out of scope. 2. I'd suggest to replace .translate with regular expressions:
py> re.sub('[^(){}\[\]]','','foo(b[a]{r}≠)') '([]{})' I'm sure people interested in performance will want to time this approach. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21765> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com