[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-07 Thread Stephen J. Turnbull
Steve Holden writes: > In which case, wouldn't "_" make a better literal prefix than "i"? There's no reason to suppose that "i" would be drop-in compatible for GNU gettext (for example, gettext purely deals with the message catalog lookup, while i-strings might be able to deal with currency

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-07 Thread Steve Holden
In which case, wouldn't "_" make a better literal prefix than "i"? A better comparison might be between _"..." and f"...". regards Steve Holden On Thu, Dec 5, 2019 at 5:37 AM Serhiy Storchaka wrote: > 04.12.19 16:02, Anders Munch пише: > > Victor Stinner [mailto:vstin...@python.org] wrote: >

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Victor Stinner
Le jeu. 5 déc. 2019 à 12:14, Thomas Wouters a écrit : > It should, but it doesn't always :) If you forget how your data is flawed, > the 'smarter' decision can easily be wrong, instead. I do think it's a good > idea to reject ideas that would break a certain number of PyPI packages, say, > but

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Victor Stinner
Please try to get an email client which is able to reply in a thread, rather than creating a new thread each time you send an email. You might want to try HyperKitty: https://mail.python.org/archives/list/python-dev@python.org/ Victor Le jeu. 5 déc. 2019 à 10:50, Anders Munch a écrit : > > >>

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Thomas Wouters
On Wed, Dec 4, 2019 at 6:37 PM Victor Stinner wrote: > Le mer. 4 déc. 2019 à 14:49, Thomas Wouters a écrit : > >> (...) > >> It's very different if an incompatible change break 1% or 90% of > >> Python projects. > > > > Unfortunately there is a distinctive bias if you select popular > projects,

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Anders Munch
>> I'm struggling to see what i-strings would do for i18n that str.format >> doesn't do better. Serhiy Storchaka [mailto:storch...@gmail.com] > You would not need to repeat yourself. > _('{name} costs ${price:.2f}').format(name=name, price=price) A small price to pay for having a

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-05 Thread Anders Munch
Barry Warsaw [mailto:ba...@python.org] wrote: > str.format() really isn’t enough to do proper i18n; it’s actually a fairly > complex topic. Obviously. > I’m not convinced that PEP 501 would provide much benefit on the technical > side. My point exactly. > flufl.i18n -

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Serhiy Storchaka
04.12.19 16:02, Anders Munch пише: Victor Stinner [mailto:vstin...@python.org] wrote: You may want to have a look at the deferred PEP 501 -- General purpose string interpolation: https://www.python.org/dev/peps/pep-0501/ I'm struggling to see what i-strings would do for i18n that str.format

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Barry Warsaw
On Dec 4, 2019, at 06:02, Anders Munch wrote: > > Victor Stinner [mailto:vstin...@python.org] wrote: >> You may want to have a look at the deferred PEP 501 -- General purpose >> string interpolation: >> https://www.python.org/dev/peps/pep-0501/ > > I'm struggling to see what i-strings would do

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Ned Batchelder
On 12/3/19 1:07 PM, Ethan Furman wrote: On 12/03/2019 09:16 AM, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python 2.7 we will remove some deprecated features

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Brett Cannon
Greg Ewing wrote: > On 4/12/19 8:41 am, Christian Heimes wrote: > > I'm strongly against removing it from Python 3 or > > even > > raising a deprecation warning. > > I agree. I know there is a maintenance cost to keeping > things like this around, but in this case it's pretty > minor. We've

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Mike Miller
On 2019-12-03 18:41, Ned Batchelder wrote: > Has anyone yet given a reason to remove it? It will change working code into > broken code. Why do that? I've heard a few complaints over the years about the number of combinations of string prefixes being a problem and a high barrier to new ones

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
Le mer. 4 déc. 2019 à 14:49, Thomas Wouters a écrit : >> (...) >> It's very different if an incompatible change break 1% or 90% of >> Python projects. > > Unfortunately there is a distinctive bias if you select popular projects, or > even packages from PyPI. There is a very large body of work

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Guido van Rossum
On Wed, Dec 4, 2019 at 3:35 AM Ned Batchelder wrote: > On 12/4/19 3:11 AM, Serhiy Storchaka wrote: > > Why the "<>" operator and the "L" suffix was removed? > > Is this a serious question? Many things were removed in moving from > Python 2 to Python 3. It was explicitly decided that 2->3 would

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Anders Munch
Victor Stinner [mailto:vstin...@python.org] wrote: > You may want to have a look at the deferred PEP 501 -- General purpose string > interpolation: > https://www.python.org/dev/peps/pep-0501/ I'm struggling to see what i-strings would do for i18n that str.format doesn't do better. regards,

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Thomas Wouters
On Wed, Dec 4, 2019 at 1:26 PM Victor Stinner wrote: > INADA-san: > > We need to avoid major breakage. > > But we accept small breakages on every minor release. > > And u-prefix is major for now. > > IMHO we need a metric to measure the risk of an incompatible change: > estimate the percentage

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Batuhan Taskaya
> Instead, we can do: > > * Don't recommend u-prefix except in Python 2&3 code. > * Provide a tool to remove the u-prefix. Great idea, +1 from me. On Wed, Dec 4, 2019, 8:39 AM Inada Naoki wrote: > On Wed, Dec 4, 2019 at 11:49 AM Ned Batchelder > wrote: > > > > On 12/3/19 8:13 PM, Inada Naoki

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
INADA-san: > We need to avoid major breakage. > But we accept small breakages on every minor release. > And u-prefix is major for now. IMHO we need a metric to measure the risk of an incompatible change: estimate the percentage of broken Python applications. For example, run the test suite of the

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Inada Naoki
> > Is this a serious question? Many things were removed in moving from > Python 2 to Python 3. We remove garbages not only between 2 and 3. We regularly remove garbages. https://docs.python.org/3/whatsnew/3.8.html#api-and-feature-removals

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
You may want to have a look at the deferred PEP 501 -- General purpose string interpolation: https://www.python.org/dev/peps/pep-0501/ It was proposed while PEP 498 -- Literal String Interpolation (f-string) was being discussed, which was accepted: https://www.python.org/dev/peps/pep-0498/ PEP

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Ned Batchelder
On 12/4/19 3:11 AM, Serhiy Storchaka wrote: 04.12.19 04:41, Ned Batchelder пише: On 12/3/19 8:13 PM, Inada Naoki wrote: I think it is too early to determine when to remove it. Even only talking about it causes blaming war. Has anyone yet given a reason to remove it? It will change working

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Victor Stinner
Le mer. 4 déc. 2019 à 06:41, Inada Naoki a écrit : > Currently, u-prefix is very widely used. It shouldn't be removed anytime > soon. > And I agree that we shouldn't raise DeprecationWarning for now. > > But how about 5, 10, and 20 years later? No one knows it. > Let's stop discussing it. It

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Anders Munch
Chris Angelico [mailto:ros...@gmail.com] wrote: > The first one is already the case. PEP 414 reintroduced the u"..." literal > form, specifically > as a porting tool. Given that it has absolutely zero value in pure Py3 code > [...] Challenge accepted :) Here comes my https://xkcd.com/1172/

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Serhiy Storchaka
04.12.19 04:41, Ned Batchelder пише: On 12/3/19 8:13 PM, Inada Naoki wrote: I think it is too early to determine when to remove it. Even only talking about it causes blaming war. Has anyone yet given a reason to remove it? It will change working code into broken code. Why do that? Why the

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Serhiy Storchaka
03.12.19 23:44, Ned Batchelder пише: On 12/3/19 12:16 PM, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python 2.7 we will remove some deprecated features kept for

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-04 Thread Serhiy Storchaka
03.12.19 19:31, Guido van Rossum пише: I think it’s too soon to worry about this. I don’t see a reason to harass people who maintain code based that were just recently migrated. Yes, I also think that it is too early to deprecate it just now. Python 2 is not completely dead yet. But I would

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Chris Angelico
On Wed, Dec 4, 2019 at 5:22 PM Kyle Stanley wrote: > > > BTW, I think 2to3 can help to move from 2&3 code to 3-only code. > > > Instead, we can do: > > > * Don't recommend u-prefix except in Python 2&3 code. > > * Provide a tool to remove the u-prefix. > > +1, this seems like the smoothest way of

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Kyle Stanley
> BTW, I think 2to3 can help to move from 2&3 code to 3-only code. > Instead, we can do: > * Don't recommend u-prefix except in Python 2&3 code. > * Provide a tool to remove the u-prefix. +1, this seems like the smoothest way of handling it and has very minimal impact on users. In 5+ years from

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Inada Naoki
On Wed, Dec 4, 2019 at 11:49 AM Ned Batchelder wrote: > > On 12/3/19 8:13 PM, Inada Naoki wrote: > > I think it is too early to determine when to remove it. > > Even only talking about it causes blaming war. > > Has anyone yet given a reason to remove it? Note that "never" is included in ”when".

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Ned Batchelder
On 12/3/19 8:13 PM, Inada Naoki wrote: I think it is too early to determine when to remove it. Even only talking about it causes blaming war. Has anyone yet given a reason to remove it? It will change working code into broken code. Why do that? --Ned. BTW, I think 2to3 can help to move

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Inada Naoki
I think it is too early to determine when to remove it. Even only talking about it causes blaming war. BTW, I think 2to3 can help to move from 2&3 code to 3-only code. * "future" fixer can be remove legacy futures. But it seems to remove all futures, including "annotations". It should be

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Greg Ewing
On 4/12/19 8:41 am, Christian Heimes wrote: I'm strongly against removing it from Python 3 or even raising a deprecation warning. I agree. I know there is a maintenance cost to keeping things like this around, but in this case it's pretty minor. We've probably already spent more time

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Ned Batchelder
On 12/3/19 12:16 PM, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python 2.7 we will remove some deprecated features kept for compatibility with 2.7. When we are

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Ned Batchelder
On 12/3/19 2:41 PM, Christian Heimes wrote: On 03/12/2019 19.09, Barry Warsaw wrote: On Dec 3, 2019, at 09:16, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Eric V. Smith
On 12/3/2019 3:35 PM, Christian Heimes wrote: On 03/12/2019 21.04, Ethan Furman wrote: On 12/03/2019 09:31 AM, Guido van Rossum wrote: I think it’s too soon to worry about this. I don’t see a reason to harass people who maintain code based that were just recently migrated. I'm happy to go

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Antoine Pitrou
On Tue, 3 Dec 2019 09:31:22 -0800 Guido van Rossum wrote: > I think it’s too soon to worry about this. I don’t see a reason to harass > people who maintain code based that were just recently migrated. Agreed with Guido. Let's wait a couple more years and rethink it. Regards Antoine.

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Skip Montanaro
Guido> I think it’s too soon to worry about this. Simon> +100 Ditto. Besides, isn't support for u"..." just a variable and a couple tests in the earliest phase of compilation? If things are going to get deprecated/removed, I'd prefer the focus be placed on those bits which present a significant

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Christian Heimes
On 03/12/2019 21.04, Ethan Furman wrote: > On 12/03/2019 09:31 AM, Guido van Rossum wrote: > >> I think it’s too soon to worry about this. I don’t see a reason to >> harass people who maintain code based that were just recently migrated. > > I'm happy to go with this, since my libraries still do

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Simon Cross
On Tue, Dec 3, 2019 at 7:42 PM Guido van Rossum wrote: > I think it’s too soon to worry about this. I don’t see a reason to harass > people who maintain code based that were just recently migrated. > +100 ___ Python-Dev mailing list --

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Ethan Furman
On 12/03/2019 09:31 AM, Guido van Rossum wrote: I think it’s too soon to worry about this. I don’t see a reason to harass people who maintain code based that were just recently migrated. I'm happy to go with this, since my libraries still do the 2/3 straddle. Do we want to set a

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Christian Heimes
On 03/12/2019 19.09, Barry Warsaw wrote: > On Dec 3, 2019, at 09:16, Serhiy Storchaka > wrote: >> >> The 'u" string literal prefix was removed in 3.0 and reintroduced >> in 3.3 to help writing the code compatible with Python 2 and 3 >> [1]. After the dead of Python 2.7 we will remove some

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread francismb
On 12/3/19 6:31 PM, Guido van Rossum wrote: > I think it’s too soon to worry about this. I don’t see a reason to harass > people who maintain code based that were just recently migrated. +1 ... or code that will be migrated in the (near) future ;-) ... Regards, francismb

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Ethan Furman
On 12/03/2019 09:16 AM, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python 2.7 we will remove some deprecated features kept for compatibility with 2.7. When we

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Barry Warsaw
On Dec 3, 2019, at 09:16, Serhiy Storchaka wrote: > > The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to > help writing the code compatible with Python 2 and 3 [1]. After the dead of > Python 2.7 we will remove some deprecated features kept for compatibility > with

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Rhodri James
On 03/12/2019 17:16, Serhiy Storchaka wrote: The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 to help writing the code compatible with Python 2 and 3 [1]. After the dead of Python 2.7 we will remove some deprecated features kept for compatibility with 2.7. When we are

[Python-Dev] Re: Deprecating the "u" string literal prefix

2019-12-03 Thread Guido van Rossum
I think it’s too soon to worry about this. I don’t see a reason to harass people who maintain code based that were just recently migrated. On Tue, Dec 3, 2019 at 09:21 Serhiy Storchaka wrote: > The 'u" string literal prefix was removed in 3.0 and reintroduced in 3.3 > to help writing the code