In article <[EMAIL PROTECTED]>, Dan M <[EMAIL PROTECTED]> wrote: (quoting someone) > > 4. If you only have one argument, you don't need a tuple > > for string formatting. > > 5. "(dateYest)" is not a tuple anyway--the parentheses are > > superfluous 6. Single item tuples can be created with "(anitem,)" > > (notice the comma). > > That helps. I had somehow gotten the mistaken idea that string formatting > always needed a tuple, and overlooked the trailing comma. I've applied > that correction to several of my other Python scripts as well.
Doesn't always need a tuple, but does need a tuple if the parameter to be converted is already a tuple. So the tuple isn't exactly gratuitous. In fact in a way it makes your code more polymorphic, which is said to bring good luck. When you're sure that the expression that appears there on the right hand side of % is not and will never be a tuple, then the (a,) one-tuple is unnecessary. If you aren't sure, it _is_ necessary. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list