Nick Coghlan <[EMAIL PROTECTED]> wrote:

> Bill Janssen wrote:
> >> Here is a list of the conversion types that are currently supported by
> >> the % operator. First thing you notice is an eerie similarity between
> >> this and the documentation for 'sprintf'. :)
> >
> > Yes.  This is (or was) a significant advantage to the system.  Many
> > people already had mastered the C/C++ printf system of specifiers, and
> > could use Python's with no mental upgrades.  Is that no longer thought
> > to be an advantage?
(snip)
> It's possible to define the format string independently of the type specifier
> - its just that some of the fields only have an effect when certain type
> specifiers are used (e.g. precision is ignored for string and integer type
> specifiers).

For strings, it isn't (not by Python at least):

    Python 2.4.2 (#1, May 30 2006, 13:47:24)
    [GCC 3.4.6 (Gentoo 3.4.6-r1, ssp-3.4.5-1.0, pie-8.7.9)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> "%3.3s" % "abcdef"
    'abc'


-- 
Christian Tanzer                                    http://www.c-tanzer.at/

_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to