% sign in python?

Ken Starks straton at lampsacos.demon.co.uk
Fri Jul 18 05:47:36 EDT 2008


Terry Reedy wrote:
> 
> 
> korean_dave wrote:
>> What does this operator do? Specifically in this context
>>
>> test.log( "[[Log level %d: %s]]" % ( level, msg ), description )
>>
>> (Tried googling and searching, but the "%" gets interpreted as an
>> operation and distorts the search results)
> 
> Having seen a number of comments like this over the years (about the 
> difficulty of searching for symbol meanings), I just started, last 
> night, a symbol index listing nearly all Python syntax uses of 
> non-alpha-or-digit ascii symbols.  When I finish and upload it 
> somewhere, I will post an announcement with the link.
> 
> tjr
> 

This will be excellent, Terry.

For the present case, perhaps we should also point out that in
python 3.0:

" Note

The formatting operations described here are obsolete and may go away in 
    future versions of Python. Use the new String Formatting in new code."

(Taken from the provisional documentation at:

http://docs.python.org/dev/3.0/library/stdtypes.html#old-string-formatting
)



More information about the Python-list mailing list