Fix Python 3.7 pycodestyle extraneous whitespace regex FutureWarning

Python 3.7 using pycodestyle 2.4.0 results in:

~/miniconda3/lib/python3.7/site-packages/ FutureWarning: Possible nested set at position 1 EXTRANEOUS_WHITESPACE_REGEX = re.compile(r’[[({] | []}),;:]‘)


A workaround for this issue is to edit ~/miniconda3/lib/python3.7/site-packages/, replacing

# EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[\[({] | [\]}),;:]')

This eliminates the nuisance warning message.

Why this happens

This warning is a result of Python 3.7 accommodating future Unicode changes:

Support for nested sets and set operations in regular expressions as in Unicode Technical Standard #18 might be added in the future. This would change the syntax. To facilitate this future change a FutureWarning will be raised in ambiguous cases for the time being. That include sets starting with a literal ‘[’ or containing literal character sequences ‘–’, ‘&&‘, ‘~~‘, and ‘||’. To avoid a warning, escape them with a backslash. (Contributed by Serhiy Storchaka in bpo-30349.)