Stefan Behnel <stefan...@behnel.de> added the comment:
One regex related code pattern that I generally like is to assign bound methods to good names and use those. In this case, I would write _has_non_base16_digits = re.compile(b'[^0-9A-F]').search ... if _has_non_base16_digits(s): raise ... ---------- nosy: +scoder _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35559> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com