def escape(pattern):
    "Escape all non-alphanumeric characters in pattern."
    s = list(pattern)
    alphanum = _alphanum
    for i, c in enumerate(pattern):
        if alphanum not in c:
            if c == "\000":
                s[i] = "\\000"
            else:
                s[i] = "\\" + c
    return pattern[:0].join(s)

# --------------------------------------------------------------------
# internals
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/win32/Python27/Lib/re.py/escape/swapped operands of `not in`