[issue35846] Incomplete documentation for re.sub

2019-02-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue28450.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Misleading/inaccurate documentation about unknown escape 
sequences in regular expressions

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35846] Incomplete documentation for re.sub

2019-01-31 Thread Windson Yang


Windson Yang  added the comment:

I wonder if possible that c not in ASCIILETTERS when we get KeyError?

if c in ASCIILETTERS:
raise s.error('bad escape %s' % this, len(this))

--
nosy: +Windson Yang

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35846] Incomplete documentation for re.sub

2019-01-29 Thread Pascal Bugnion


New submission from Pascal Bugnion :

The documentation for `re.sub` states that "Unknown escapes such as ``\&`` are 
left alone.". This is only true for escapes which are not ascii characters, as 
far as I can tell (c.f. source on 
https://github.com/python/cpython/blob/master/Lib/sre_parse.py#L1047).

Would there be value in amending that documentation to either remove that 
sentence or to clarify it? If so, I'm happy to submit a PR on GitHub.

--
components: Regular Expressions
messages: 334504
nosy: ezio.melotti, mrabarnett, pbugnion
priority: normal
severity: normal
status: open
title: Incomplete documentation for re.sub
versions: Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com