[Python-Dev] str with base (original) (raw)

Steve Holden steve at holdenweb.com
Wed Jan 18 09:31:18 CET 2006


Adam Olsen wrote:

On 1/17/06, Bob Ippolito <bob at redivi.com> wrote:

On Jan 17, 2006, at 4:09 PM, Adam Olsen wrote:

On 1/17/06, Guido van Rossum <guido at python.org> wrote: On 1/17/06, Adam Olsen <rhamph at gmail.com> wrote:

In-favour-of-%2b-ly y'rs, My only opposition to this is that the byte type may want to use it. I'd rather wait until byte is fully defined, implemented, and released in a python version before that option is taken away. Has this been proposed? What would %b print? I don't believe it's been proposed and I don't know what it'd print. Perhaps it indicates the bytes should be passed through without conversion. That doesn't make any sense. What is "without conversion"? Does that mean UTF-8, UCS-2, UCS-4, latin-1, Shift-JIS? You can't have unicode without some kind of conversion. In any case I only advocate waiting until it's clear that bytes have no need for it before we use it for binary conversions. I don't see what business a byte type has mingling with string formatters other than the normal str and repr coercions via %s and %r respectively. Is the byte type intended to be involved in string formatters at all? Does byte("%i") % 3 have the obvious effect, or is it an error? Although upon further consideration I don't see any case where %s and %b would have different effects.. shrug I never said it did have a purpose, just that it might be given a purpose when byte was spec'd out. I suppose we'd better reserve "%q" for 'quirky types we just invented', too? ;-)

regards Steve

Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC www.holdenweb.com PyCon TX 2006 www.python.org/pycon/



More information about the Python-Dev mailing list