Re: [Python-Dev] Python 2.6.3rc1 available
2009/9/30 Ben Finney : > Barry Warsaw writes: > >> The first (and hopefully last) release candidate for Python 2.6.3 is >> now available > […] > > Thank you for this announcement, and the efforts that go into making > this work available. > > *Especially* thank you for avoiding the oxymoronic “Released: 2.6.3 > release candidate” or similar. I hope this signifies a trend toward > using the more accurate term “available” for announcing availability of > anything that's not an actual release. Alphas, betas, and release candidates are all releases, too. -- Regards, Benjamin ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] summary of transitioning from % to {} formatting
Antoine Pitrou wrote: > If we can't find a way to make things almost transparent, we should IMO > abandon > the whole idea of a transition. Yep - this is the reason some attempts at actual format translation implementations started up as a result of the previous discussion. Without that, I suspect any API transitions are going to be too much hassle to be worthwhile. Regards, Nick. -- Nick Coghlan | [email protected] | Brisbane, Australia --- ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] summary of transitioning from % to {} formatting
Brett Cannon wrote:
> No one is saying we should deprecate % any time soon on strings
> themselves or anywhere. This discussion is purely in regards to
> argparse and logging to transition *their* APIs over to {} formatting
> which would most likely involve some deprecation for *using* %
> formatting in those APIs. But % formatting on strings themselves is
> not directly being discussed here.
Actually, I think percent formatting and brace formatting should remain
fully supported peers for the life of 3.x (including in APIs such as
argparse and logging).
No matter how much we might like the new formatting system (and I
certainly prefer it), there's a long period of evangelisation and
performance improvements that needs to happen before we can
realistically start to deprecate percent formatting based APIs in any
way shape or form.
Until that happens, then users do have the right to dig in their heels
and say "look, the limitations on percent formatting really don't bother
us, certainly not enough to switch to a new formatting system".
Cheers,
Nick.
--
Nick Coghlan | [email protected] | Brisbane, Australia
---
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
On 1 Oct 2009, at 10:37, M.-A. Lemburg wrote:
Eric Smith wrote:
Martin v. Löwis wrote:
Steven Bethard wrote:
There's a lot of code already out there (in the standard library
and
other places) that uses %-style formatting, when in Python 3.0 we
should be encouraging {}-style formatting.
I don't agree that we should do that. I see nothing wrong with using
% substitution.
I agree with Martin.
Both approaches have their ups and downs, but forcing users to move
from %-formatting to .format()-formatting will just frustrate them:
having to convert several thousand such (working) uses in their code
with absolutely no benefit simply doesn't look like a good way to
spend your time.
I agree you cannot force the move to {} format. There are programs that
expose the %(name)s in user interfaces for customisation.
In addition to the code changes, such a move would also render
existing translations of the %-formatted string templates useless.
Speaking of translation support has xgettext been updated to support {}?
It is a life saver to have xgettext report that "This %s and %s" is not
translatable.
Barry
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Python 2.6.3rc1 available
Benjamin Peterson wrote: > 2009/9/30 Ben Finney : >> Barry Warsaw writes: >> >>> The first (and hopefully last) release candidate for Python 2.6.3 is >>> now available >> […] >> >> Thank you for this announcement, and the efforts that go into making >> this work available. >> >> *Especially* thank you for avoiding the oxymoronic “Released: 2.6.3 >> release candidate” or similar. I hope this signifies a trend toward >> using the more accurate term “available” for announcing availability of >> anything that's not an actual release. > > Alphas, betas, and release candidates are all releases, too. Not really - they're just key builds that are made available in the lead up to the actual release. Using " is available" for the pre-release builds and then "RELEASED: " for the actual release as Barry did this time around makes a great deal of sense to me. Cheers, Nick. -- Nick Coghlan | [email protected] | Brisbane, Australia --- ___ Python-Dev mailing list [email protected] http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
On Sat, Oct 3, 2009 at 11:05, Brett Cannon wrote:
> On Fri, Oct 2, 2009 at 20:03, Raymond Hettinger wrote:
>>
>> [Terry Reedy]
>>>
>>> I would agree, for instance, that an auto-translation tool is needed.
>>
>> We should get one written. ISTM, every %-formatting
>> string is directly translatable to an equivalent {}-formatting string.
>
> Why don't we start something in the sandbox and see how far we can
> get. If no one beats me to it I will add the directory some time today
> and we can start hashing out the solution there.
Created str_fmt_conversion in the sandbox to hold any work people want
to do on converting % formats to {} automatically.
-Brett
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
>> Do the users get any say in this?
>
> I'm a user! :-)
>
> I hate calling methods on string literals, I think it looks very odd to
> have code like this:
>
> "Displaying {0} of {1} revisions".format(x, y)
>
> Will we be able to write this as
>
> "Displaying {0} of {1} revisions" % (x, y)
>
> too?
>
>> I imagine that some people are heavily invested in %-formatting.
>>
>> Because there has been limited uptake on {}-formatting (afaict), we
>> still have limited experience with knowing that it is actually better,
>> less error-prone, easier to learn/rember, etc. Outside a handful of
>> people on this list, I have yet to see anyone adopt it as the
>> preferred syntax.
>
> I've skimmed over the PEP, and the new {}-syntax seems to have some nice
> features. But I've not seen it used anywhere yet.
>
Rami Chowdhury posted this to a mailing list; I've been using it
(perhaps unintentionally promoting it) as part of non-English,
non-ASCII font outreach:
> def শালাম_বল(নাম):
>কথা = "শালাম {0}. কেমন আছেন?".format(নাম)
>print(কথা)
>
> def say_greeting(name):
> to_say = "Greetings, {0}. How are you?".format(name)
> print(to_say)
As a user, my assumption was {} was going forward, rain or shine, and
everyone should be on board by Python 3.2. (I thought once the Talin
PEP got approved, that was it). I wrote Steven Bethard privately
about this.
Sorry for the intrusion.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
What about using string prefix 'f'?
f"{foo} and {bar}" % something == "{foo} and {bar}.format(something)
s = f"{foo}"
t = "%(bar)s"
s + t # raises Exception
Transition plan:
n: Just add F prefix. And adding "format_string" in future.
n+1: deprecate __mod__() without 'F'.
n+2: libraries use .format() and deprecate __mod__() with 'F'
n+3: remove __mod__()
--
Naoki INADA
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
> -1 That requires keeping formatting information around in every string
> instance.
Adding new "format_string" class avoids it.
unicode("foo") <=> u"foo"
format_string("foo") <=> f"foo"
This way's pros:
* Many libraries can use one transition way.
* Transition stage syncs to Python version. "library A uses {} and
library B uses %" problem not happen in transition.
* We have experience same way on unicode.
--
Naoki INADA
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
Carl Trachte wrote:
I've skimmed over the PEP, and the new {}-syntax seems to have some nice
features. But I've not seen it used anywhere yet.
I am using it with 3.1 in an unreleased book I am still writing, and
will in any code I publish.
Rami Chowdhury posted this to a mailing list; I've been using it
(perhaps unintentionally promoting it) as part of non-English,
non-ASCII font outreach:
def শালাম_বল(নাম):
কথা = "শালাম {0}. কেমন আছেন?".format(নাম)
print(কথা)
def say_greeting(name):
to_say = "Greetings, {0}. How are you?".format(name)
print(to_say)
As a user, my assumption was {} was going forward, rain or shine, and
everyone should be on board by Python 3.2.
Autonumbering, added in 3.1, makes '{}' as easy to write for simple
cases as '%s'. That was one complaint about the original 3.0 version.
Another was and still is the lack of conversion, which is being worked on.
(I thought once the Talin
PEP got approved, that was it). I wrote Steven Bethard privately
about this.
Sorry for the intrusion.
tjr
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] transitioning from % to {} formatting
> I agree with this 100% but I can't see it working unless we have some
> sort of transition plan. Just saying "ok, switch your format strings
> from % to {}" didn't work in Python 3.0 for various good reasons, and
> I can't imagine it will work in Python 4.0 unless we have a transition
> plan.
That doesn't mean we have to have a transition plan *now*. Creating one
after Python 3.5 is released (i.e. in 2015 or so) might be sufficient.
To create a transition plan, you first need *consensus* that you
actually do want to transition. I don't think such consensus is
available, and might not be available for a few more years. Pushing
the issue probably delays obtaining consensus.
Regards,
Martin
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
