[Tutor] What are these two string-formatting styles called?

Dave Angel davea at davea.name
Sun Jun 16 08:27:31 CEST 2013


On 06/16/2013 01:40 AM, Dotan Cohen wrote:
> On Sat, Jun 15, 2013 at 2:32 PM, Dave Angel <davea at davea.name> wrote:
>>> Thank you. So would it be clear if I were to say "I prefer
>>> printf-style formatting over the format method."?
>>>
>>
>> I'd be careful there, since method is an English word as well as a Python
>> one.  So I'd make it clear i was referrring to a method of a class, by
>> naming the class.
>>
>> Something like:
>>
>> the format() method of the str class.
>>
>
> Actually, I specifically said 'method' in the OOP-sense of the word. I
> don't see any ambiguity, as there is no other relevant class that I
> know of which has a format() method. But I'm here to learn, and I
> would love nothing more than for you to tell me where the sentence is
> ambiguous.
>

You were thinking of the OOP-sense of the word, but you didn't say it. 
So the listener might choose to figure you meant "method" as in 
"technique".  After all the word style is used in its English meaning, 
even though Word documents can have styles.

You're quite right that once we're thinking in the OOPS-sense, there's 
no ambiguity.  But I figure a few words more were needed to make sure 
the listener is in sync.  And the easiest way to make sure it's clear we 
mean a class-method is to name the class.  If it were being written, the 
parentheses might be enough.  But parentheses are usually silent when 
speaking.




-- 
DaveA


More information about the Tutor mailing list