On Tue, Jun 30, 2020 at 10:25:45PM +1000, Chris Angelico wrote:
> Be careful of semantics here. I'm not sure which languages do what,
> but I just checked Perl, and "\x{1234}" is equivalent to Python's
> "\u1234", not to "\x12\x34". This proposal is for the latter, which
> could be sneakily confus
On Tue, Jun 30, 2020 at 09:04:15PM +0300, Mikhail V wrote:
> > Counter-proposal: hex escapes allow optional curly brackets, similar to
> > unicode name escapes. You could even allow spaces within the braces, for
> > grouping:
> >
> > # Proposed enhancement:
> > "\x{2b}2c" # '+2c'
> >
On Tue, Jun 30, 2020 at 5:05 AM Steven D'Aprano wrote:
> For single-character escape codes, I see no benefit at all to this, only
> disadvantages. However I do see a tiny potential benefit to hex escapes,
> for the rare occassions that they are immediately followed by something
> that looks like
On 2020-06-30 17:20, Chris Angelico wrote:
On Wed, Jul 1, 2020 at 1:57 AM MRAB wrote:
On 2020-06-30 13:25, Chris Angelico wrote:
> On Tue, Jun 30, 2020 at 2:28 PM MRAB wrote:
>>
>> On 2020-06-30 02:14, Steven D'Aprano wrote:
>> [snip]
>> > Counter-proposal: hex escapes allow optional curly br
On Wed, Jul 1, 2020 at 1:57 AM MRAB wrote:
>
> On 2020-06-30 13:25, Chris Angelico wrote:
> > On Tue, Jun 30, 2020 at 2:28 PM MRAB wrote:
> >>
> >> On 2020-06-30 02:14, Steven D'Aprano wrote:
> >> [snip]
> >> > Counter-proposal: hex escapes allow optional curly brackets, similar to
> >> > unicode
On 2020-06-30 13:25, Chris Angelico wrote:
On Tue, Jun 30, 2020 at 2:28 PM MRAB wrote:
On 2020-06-30 02:14, Steven D'Aprano wrote:
[snip]
> Counter-proposal: hex escapes allow optional curly brackets, similar to
> unicode name escapes. You could even allow spaces within the braces, for
> group
On Tue, Jun 30, 2020 at 2:28 PM MRAB wrote:
>
> On 2020-06-30 02:14, Steven D'Aprano wrote:
> [snip]
> > Counter-proposal: hex escapes allow optional curly brackets, similar to
> > unicode name escapes. You could even allow spaces within the braces, for
> > grouping:
> >
> > # Existing:
> >
On Mon, Jun 29, 2020 at 21:30 MRAB wrote:
> On 2020-06-30 02:14, Steven D'Aprano wrote:
> [snip]
> > Counter-proposal: hex escapes allow optional curly brackets, similar to
> > unicode name escapes. You could even allow spaces within the braces, for
> > grouping:
> >
> > # Existing:
> >
On 29/06/2020 15:29, Mikhail V wrote:
Proposal:
Allow standard python escapes inside curly braces in f-strings.
Main point is to make clear visual distinction between text and
escaped chars:
# current syntax:
print ("\nnewline")
print ("\x0aa")
# new syntax:
print (f"{\
On 2020-06-30 02:14, Steven D'Aprano wrote:
[snip]
Counter-proposal: hex escapes allow optional curly brackets, similar to
unicode name escapes. You could even allow spaces within the braces, for
grouping:
# Existing:
"\N{HYPHEN-MINUS}" # '-'
"\x2b" # '+'
# Proposed enhanc
On Mon, Jun 29, 2020 at 05:29:31PM +0300, Mikhail V wrote:
> Proposal:
>
> Allow standard python escapes inside curly braces in f-strings.
> Main point is to make clear visual distinction between text and
> escaped chars:
There is already a clear visual distinction between text and escaped
chars
The reason backslashes don't currently work is because of how they'd
interact with string parsing. I don't think this will change until we
move f-string parsing into the grammar itself, instead of happening as a
post-processing step in ast.c. See bpo-33754 for one example of this.
There have be
12 matches
Mail list logo