Serhiy Storchaka writes:
> Seems the documentation is not accurate. Could you file a report on
> https://bugs.python.org/ ?
Thank you everybody answered!
Here it is: http://bugs.python.org/issue28450
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanu
Serhiy Storchaka wrote:
> On 14.10.16 20:01, Peter Otten wrote:
> def double_bs(s): return "".join(s.split("\\"))
>> ...
> Just use s.replace('\\', r'\\').
D'oh!
--
https://mail.python.org/mailman/listinfo/python-list
On 14.10.16 19:15, Chris Angelico wrote:
I wasn't specifically aware that the re module was doing the same
thing, but it'll be from the same purpose and goal. The idea is that,
for instance, Windows path names in non-raw string literals will no
longer behave differently based on whether the path
On 14.10.16 20:01, Peter Otten wrote:
Lele Gaifax wrote:
So, how am I supposed to achieve the mentioned intent? By doubling the
escape in the replacement?
If there are no escape sequences aimed to be handled by re.sub() you can
escape the replacement wholesale:
re.sub(r'\s+', re.escape(r'\s+
On 14.10.16 18:40, Lele Gaifax wrote:
Hi all,
trying out pgcli with Python 3.6.0b2 I got an error related to what seem a
different behaviour, or even a bug, of re.sub().
The original intent is to replace spaces within a string with the regular
expression
\s+ (see
https://github.com/dbcli/pgcl
On Sat, Oct 15, 2016 at 4:48 AM, Ned Batchelder wrote:
> On Friday, October 14, 2016 at 1:27:09 PM UTC-4, Chris Angelico wrote:
>> On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder
>> wrote:
>> > There doesn't seem to be a change to string literals at all. It's only a
>> > change in the regex engi
On Friday, October 14, 2016 at 1:27:09 PM UTC-4, Chris Angelico wrote:
> On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder
> wrote:
> > There doesn't seem to be a change to string literals at all. It's only a
> > change in the regex engine.
> >
> > Python 3.6.0b2 (default, Oct 10 2016, 21:30:05
Ned Batchelder writes:
> On Friday, October 14, 2016 at 12:50:44 PM UTC-4, Lele Gaifax wrote:
>> Chris Angelico writes:
>>
>> > There's a shift as of 3.6 to make unrecognized alphabetic escapes into
>> > errors, or at least warnings.
>>
>> But we are talking about raw strings here, specificall
On Sat, Oct 15, 2016 at 4:12 AM, Ned Batchelder wrote:
> There doesn't seem to be a change to string literals at all. It's only a
> change in the regex engine.
>
> Python 3.6.0b2 (default, Oct 10 2016, 21:30:05)
> [GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
> Typ
On Friday, October 14, 2016 at 1:00:12 PM UTC-4, Chris Angelico wrote:
> On Sat, Oct 15, 2016 at 3:45 AM, Lele Gaifax wrote:
> > Chris Angelico writes:
> >
> >> There's a shift as of 3.6 to make unrecognized alphabetic escapes into
> >> errors, or at least warnings.
> >
> > But we are talking abo
On Friday, October 14, 2016 at 12:50:44 PM UTC-4, Lele Gaifax wrote:
> Chris Angelico writes:
>
> > There's a shift as of 3.6 to make unrecognized alphabetic escapes into
> > errors, or at least warnings.
>
> But we are talking about raw strings here, specifically r'\s+'.
>
> I agree that with
Lele Gaifax wrote:
> Peter Otten <__pete...@web.de> writes:
>
>> Lele Gaifax wrote:
>>
>>> The original intent is to replace spaces within a string with the
>>> regular expression \s+ (see
>>> ...
>>> Accordingly to the documentation
>>> (https://docs.python.org/3.6/library/re.html#re.sub) “unkno
On Sat, Oct 15, 2016 at 3:45 AM, Lele Gaifax wrote:
> Chris Angelico writes:
>
>> There's a shift as of 3.6 to make unrecognized alphabetic escapes into
>> errors, or at least warnings.
>
> But we are talking about raw strings here, specifically r'\s+'.
>
> I agree that with plain strings it's a
Lele Gaifax writes:
> And the documentation as well, to clarify the fact immediately, without
> assuming one will scroll down to the "changed in version" part (at least, that
> is what seem the rule in other parts of the manual).
Also, I'd prefer the "Changed in 3.6" be less ambiguous whether it
Chris Angelico writes:
> There's a shift as of 3.6 to make unrecognized alphabetic escapes into
> errors, or at least warnings.
But we are talking about raw strings here, specifically r'\s+'.
I agree that with plain strings it's a plus.
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di q
Peter Otten <__pete...@web.de> writes:
> Lele Gaifax wrote:
>
>> The original intent is to replace spaces within a string with the regular
>> expression \s+ (see
>> ...
>> Accordingly to the documentation
>> (https://docs.python.org/3.6/library/re.html#re.sub) “unknown escapes [in
>> the repl argu
Lele Gaifax wrote:
> Hi all,
>
> trying out pgcli with Python 3.6.0b2 I got an error related to what seem a
> different behaviour, or even a bug, of re.sub().
>
> The original intent is to replace spaces within a string with the regular
> expression \s+ (see
>
https://github.com/dbcli/pgcli/blo
On Sat, Oct 15, 2016 at 2:40 AM, Lele Gaifax wrote:
> Accordingly to the documentation
> (https://docs.python.org/3.6/library/re.html#re.sub)
> “unknown escapes [in the repl argument] such as \& are left alone”.
>
> Am I missing something, or is this a regression?
Further down, you'll find this
Hi all,
trying out pgcli with Python 3.6.0b2 I got an error related to what seem a
different behaviour, or even a bug, of re.sub().
The original intent is to replace spaces within a string with the regular
expression
\s+ (see
https://github.com/dbcli/pgcli/blob/master/pgcli/packages/prioritizat
19 matches
Mail list logo