Eric Smith wrote:
> The problem is that if an object does does its own
> __format__, it either needs to understand all of the string formatting,
> or at least recognize a string format and send it along to
> string.__format__() (or object.__format__, which will convert to string
> for you).
No
On 8/20/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > But how often will you need this? (You only need the !s part if you
> > don't know that the argument is a string.)
>
> Maybe I'm confused. I thought we had agreed that most
> types would delegate to str if they didn't u
Greg Ewing wrote:
> Guido van Rossum wrote:
>> But how often will you need this? (You only need the !s part if you
>> don't know that the argument is a string.)
>
> Maybe I'm confused. I thought we had agreed that most
> types would delegate to str if they didn't understand
> the format, so most o
Guido van Rossum wrote:
> But how often will you need this? (You only need the !s part if you
> don't know that the argument is a string.)
Maybe I'm confused. I thought we had agreed that most
types would delegate to str if they didn't understand
the format, so most of the time there wouldn't be a
On 8/20/07, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Eric Smith wrote:
> > Guido van Rossum wrote:
> >
> > > Why? The conversion code can just generate !s:-20 instead of :-20s.
> >
> > Talin: On your list of to-do items for the PEP, could you add that the
> > only conversions for the standard conve
Eric Smith wrote:
> Guido van Rossum wrote:
>
> > Why? The conversion code can just generate !s:-20 instead of :-20s.
>
> Talin: On your list of to-do items for the PEP, could you add that the
> only conversions for the standard conversion specifiers are int <-> float?
Please, no! While the c
Guido van Rossum wrote:
>> Converting to strings doesn't really buy you much, since we have the !s
>> specifier. But I think it's needed for backward compatibility with %
>> formatting.
>
> Why? The conversion code can just generate !s:-20 instead of :-20s.
True enough. I'll take it out, too.
T
On 8/20/07, Eric Smith <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > On 8/19/07, Eric Smith <[EMAIL PROTECTED]> wrote:
> >> Talin wrote:
> >>> Wow, excellent feedback. I've added your email to the list of reminders
> >>> for the next round of edits.
> >> Here's something else for future
Guido van Rossum wrote:
> On 8/19/07, Eric Smith <[EMAIL PROTECTED]> wrote:
>> Talin wrote:
>>> Wow, excellent feedback. I've added your email to the list of reminders
>>> for the next round of edits.
>> Here's something else for future edits:
>>
>> 1. When converting a string to an integer, what s
On 8/19/07, Eric Smith <[EMAIL PROTECTED]> wrote:
> Talin wrote:
> > Wow, excellent feedback. I've added your email to the list of reminders
> > for the next round of edits.
>
> Here's something else for future edits:
>
> 1. When converting a string to an integer, what should the rules be?
> Should
Eric Smith wrote:
> 2. I'm making the format specifiers as strict as I can. So, I've made
> these ValueError's:
I should have mentioned that I expect there to be criticism of this
decision. I'd like to start with making the specifier parser strict, we
can always loosen it if we find the need
Talin wrote:
> Wow, excellent feedback. I've added your email to the list of reminders
> for the next round of edits.
Here's something else for future edits:
1. When converting a string to an integer, what should the rules be?
Should:
format("0xd", "d")
produce "13", or should it be an error?
Wow, excellent feedback. I've added your email to the list of reminders
for the next round of edits.
Jim Jewett wrote:
> The PEP says:
>
> The general form of a standard format specifier is:
>
> [[fill]align][sign][width][.precision][type]
>
> but then says:
>
> A zero fill char
The PEP says:
The general form of a standard format specifier is:
[[fill]align][sign][width][.precision][type]
but then says:
A zero fill character without an alignment flag
implies an alignment type of '='.
In the above form, how can you get a fill character without an
align
14 matches
Mail list logo