[Python-ideas] What about allowing '?' in method names?

Georg Brandl g.brandl at gmx.net
Tue Aug 11 19:33:13 CEST 2009

Masklinn schrieb:
> On 11 Aug 2009, at 15:25 , Arnaud Delobelle wrote:
>> On 11 Aug 2009, at 11:43, Antoine Pitrou wrote:
>> Steven D'Aprano <steve at ...> writes:
>>>> What makes you think that the question mark is a clue-in that a  
>>>> yes/no
>>>> answer is expected?
>>> AFAIK it is a widely-used convention in the Ruby world.
>>> I'd even go as far as saying that it's quite pretty, as a  
>>> typographical
>>> convention (not that other Ruby conventions are :-))
>> Also in Scheme. (I think the question mark more or less replaces the  
>> 'p' suffix used in LISP).
> It does, and Ruby's idea of using the "?" postfix for boolean query  
> (instead of an `is` or `is_` prefix) comes from there.

But, and I believe that was Steven's point, it is no more than a convention.
Omitting the "is_" prefix makes for a "question" that isn't unambiguously
a yes/no question anymore in many cases.


Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

More information about the Python-ideas mailing list