Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Filip Gruszczyński
>> I'm inclined to leave it alone unless/until Raymond or somebody else >> steps up to really champion it. > > I'm okay with that. And I am looking for another bug, that I could get some python-fu from ;-) -- Filip Gruszczyński ___ Python-Dev mailing l

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Eric Smith
Nick Coghlan wrote: Completely agree on all points. Now we're just left with "is it worth expanding the str api for this?". I don't feel strongly either way. For something as core as the string API, we better feel darn strongly about it before we mess with it :) I'm inclined to leave it alone

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Antoine Pitrou
Nick Coghlan gmail.com> writes: > > For something as core as the string API, we better feel darn strongly > about it before we mess with it :) Having two very similar methods with different names and subtly different APIs sounds bad IMHO. Also, the use case doesn't look very strong to me. > P.S

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Nick Coghlan
Eric Smith wrote: > Nick Coghlan wrote: >> Moving the decision of "how am I going to be called" to the time of >> writing the format string is a bit odd. >> >> On the other hand, the specially crafted format string does have the >> virtue of travelling far more easily through any APIs that wrap the

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Eric Smith
Nick Coghlan wrote: Moving the decision of "how am I going to be called" to the time of writing the format string is a bit odd. On the other hand, the specially crafted format string does have the virtue of travelling far more easily through any APIs that wrap the basic format() method (since it

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Nick Coghlan
Eric Smith wrote: > Considering that, maybe the best thing is to do nothing. I'll update the > issue with this note. I agree this slightly weakens the case for change, but it's not really the same thing. Adding a "format_mapping" method allows an arbitrary mapping to be used with any keyword-based

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Eric Smith
Nick Coghlan wrote: Filip Gruszczyński wrote: I would appreciate any advice on this topic, even if this ticket would be dismissed altogether, as I would like to learn as much as possible on practices on developing Python. Raymond's use case is valid, but the currently proposed method name is w

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Eric Smith
Filip Gruszczyński wrote: From that spec, a straightforward API falls out: def format_mapping(self, kwds): # Method body actually written in C, so it can # easily invoke the internal formatting operation return do_string_format(self, NULL, kwds) Thanks a lot for the advice, I

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Filip Gruszczyński
> From that spec, a straightforward API falls out: > >    def format_mapping(self, kwds): >      # Method body actually written in C, so it can >      # easily invoke the internal formatting operation >      return do_string_format(self, NULL, kwds) Thanks a lot for the advice, I'll provide accord

Re: [Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-25 Thread Nick Coghlan
Filip Gruszczyński wrote: > I would appreciate any advice on this topic, even if this ticket would > be dismissed altogether, as I would like to learn as much as possible > on practices on developing Python. Raymond's use case is valid, but the currently proposed method name is way too long to be

[Python-Dev] Issue 6081: format string using mapping rather than kwargs

2010-03-24 Thread Filip Gruszczyński
Hello everyone, I was told to bring this issue to python-dev, but I was reluctant to do this until I was confident I can solve the problem. I have managed to provide the patch that works, so now I can talk about how this should be done, just as Eric told me. Here is the link to the ticket: http://