Re: [Python-3000] PEP 3101 clarification requests

2007-08-21 Thread Greg Ewing
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-21 Thread Guido van Rossum
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-21 Thread Eric Smith
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Greg Ewing
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Guido van Rossum
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Greg Ewing
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Eric Smith
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Guido van Rossum
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Eric Smith
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-20 Thread Guido van Rossum
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-19 Thread Eric Smith
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

Re: [Python-3000] PEP 3101 clarification requests

2007-08-19 Thread Eric Smith
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?

Re: [Python-3000] PEP 3101 clarification requests

2007-08-17 Thread Talin
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

[Python-3000] PEP 3101 clarification requests

2007-08-17 Thread Jim Jewett
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