I'm a Rubyist learning Python and I'm wondering if there is a convention in Python along the lines of the following.
In Ruby, methods that return booleans are supposed to always end in a ?
. For example,
def palindrome?(string)
# some code that tests whether string is a palindrome
end
The only existing SO question I can find speaking to this does not provide a definitive answer.
?
is not allowed in Python function names, and since Englishis
is restricted to (3rd person) singular present tense questions of being (as opposed to other verbs), I suggest we use a more general yes/no question marker from another language that doesn't suffer the same problems, such as Japanese "ka" suffix.