Re: Possible re bug when using ".*"

2022-12-28 Thread Ethan Furman
On 12/28/22 11:07, MRAB wrote: On 2022-12-28 18:42, Alexander Richert - NOAA Affiliate via Python-list wrote:   In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "replacementreplacement".

Re: Possible re bug when using ".*"

2022-12-28 Thread MRAB
On 2022-12-28 18:42, Alexander Richert - NOAA Affiliate via Python-list wrote: In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "replacementreplacement". This behavior does not occur in

Re: Possible re bug when using ".*"

2022-12-28 Thread Roel Schroeven
Roel Schroeven schreef op 28/12/2022 om 19:59: Alexander Richert - NOAA Affiliate via Python-list schreef op 28/12/2022 om 19:42: In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "repla

Re: Possible re bug when using ".*"

2022-12-28 Thread Roel Schroeven
Alexander Richert - NOAA Affiliate via Python-list schreef op 28/12/2022 om 19:42: In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "replacementreplacement". This behavior does not occu

Possible re bug when using ".*"

2022-12-28 Thread Alexander Richert - NOAA Affiliate via Python-list
In a couple recent versions of Python (including 3.8 and 3.10), the following code: import re print(re.sub(".*", "replacement", "pattern")) yields the output "replacementreplacement". This behavior does not occur in 3.6. Which behavior is the desired one? Perhaps relatedly, I noticed that even i

Re: How make your module substitute a python stdlib module.

2022-12-28 Thread Thomas Passin
On 12/28/2022 5:39 AM, Antoon Pardon wrote: Op 27/12/2022 om 16:49 schreef Thomas Passin: On 12/27/2022 8:25 AM, Antoon Pardon wrote: Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon Pardon wrote: At the moment I am happy with a solution that once the prog

Re: How make your module substitute a python stdlib module.

2022-12-28 Thread Antoon Pardon
Op 27/12/2022 om 16:49 schreef Thomas Passin: On 12/27/2022 8:25 AM, Antoon Pardon wrote: Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon Pardon  wrote: At the moment I am happy with a solution that once the programmer has imported from QYZlib.threaders th