[issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions
New submission from mollison : This is regarding the change to re.sub() between 3.6 and 3.7 that results in different behavior even for simple cases like the following: re.sub('a*','b', 'a') returns 'b' in 3.6 and 'bb' in 3.7 This change is well documented here: https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api However, it is not well documented here: https://docs.python.org/3.7/library/re.html The latter document does actually contain the appropriate text: "Empty matches for the pattern are replaced when adjacent to a previous non-empty match." However, the formatting makes this text look like it was always there, and is not part of the 3.7 changes announcement. That is how I interpreted it, leading to some lost productivity. After so many years, people don't expect the regex engine to change like this, and that only makes it easier to misinterpret that text as always have been there vs. being new to 3.7. Related: https://bugs.python.org/issue32308 -- assignee: docs@python components: Documentation messages: 340370 nosy: docs@python, mollison priority: normal severity: normal status: open title: re.sub() library entry does not adequately document surprising change in behavior between versions versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue36645> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions
mollison added the comment: You have not understood my message. I know that text is already there. My point is that because it's in a separate paragraph, it looks like it's not part of Changed in 3.7. There is nowhere else on the page where a change description is in a separate paragraph from the "Changed in version X.X:" text. When I came across this I thought, this probably goes with the paragraph before it, right? In other words, it's probably another change from 3.7, just in a different paragraph? But then I thought, no, they probably wouldn't change something like that (i.e. basic regex stuff) after so many years. So it's not that obvious. -- ___ Python tracker <https://bugs.python.org/issue36645> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions
mollison added the comment: @brett.cannon: Yes, I will submit a PR. I have the code ready to go already. I just submitted the Python contributor agreement. I think it will take the system a day or two to register that. Then, I will submit the PR. -- ___ Python tracker <https://bugs.python.org/issue36645> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions
Change by mollison : -- keywords: +patch pull_requests: +12803 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36645> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36645] re.sub() library entry does not adequately document surprising change in behavior between versions
mollison added the comment: @brett.cannon: PR is at https://github.com/python/cpython/pull/12879 -- ___ Python tracker <https://bugs.python.org/issue36645> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com