The two entries are not related, and re.sub
will not be deprecated.
In Python version earlier than 3.5 re.sub
failed if a backreference was used to a capturing group that did not participate in the match. See Empty string instead of unmatched group error SO question.
An example where the failure occurred:
import re
old = 'regexregex'
new = re.sub(r'regex(group)?regex', r'something\1something', old)
print(new) # => fail as there is no "group" in between "regex" and "regex" in "regexregex"
# and Group 1 was not initialized with an empty string, i.e. remains null
As for the second one, it only says that there will be a warning (and later forbidden) if you use an unknown for a regex engine literal backslash followed with an ASCII character. The backslash was just ignored in them before, in Python 2.x through 3.5, print(re.sub(r'\j', '', 'joy'))
prints oy
. So, these will be forbidden in Python 3.6.