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

Steven D'Aprano steve at pearwood.info
Sat Aug 8 03:53:38 CEST 2009

On Sat, 8 Aug 2009 11:07:30 am Tennessee Leeuwenburg wrote:
> Hi all,
> Well, the thread's basically concluded, but I'm not sure if it's
> appropriate to just 'leave it hanging' seeing as I instigated the
> thread. So thanks all for the discussion points and I think we can
> wrap things up now. Please feel free to comment on the summary below
> if you think it doesn't have all the relevant details.
> To summarise the discussion for posterity:
> On the Plus Side:
>    ? is part of English grammar, and is an intuitive clue-in that a
> yes/no, true/false response is expected as a result.

What makes you think that the question mark is a clue-in that a yes/no 
answer is expected?

When did you come up with the idea?

Who would agree with you?

Where can I see some evidence for that suggestion?

Excepting rhetorical questions, ? is an intuitive clue-in that a 
response is required, with no limitation on the nature of the response. 
Who/what/why/how/when questions expect open-ended answers. It seems to 
me that the clue-in that a yes/no answer is expected comes from 
existence words and intention words, those related to be and will:

Is there a doctor in the house?
Would you pass me the spanner?
Can I do this?

In any case, I don't think that "returns a boolean flag" versus "returns 
a non-flag" is an important distinction. Flags can be used as arbitrary 
objects, and non-flags can be used as flags.

Steven D'Aprano

More information about the Python-ideas mailing list