[Python-ideas] What about allowing '?' in method names?
ben+python at benfinney.id.au
Thu Aug 6 11:40:51 CEST 2009
<tleeuwenburg at gmail.com> writes:
> I'm trying out an idiom of ending True/False returners with 'Q', i.e.
> self.isSomethingTheCaseQ() or self.shouldSomethingHappenQ() or
> self.getSomeFlagQ()... I find that's reasonably aesthetically
> pleasing, and is a good hint about what the method is for.
If you want it to be more likely to be recognisable to programmers (and
I would advise you to conform these names to PEP 8), you could name it
as “foo_p” which is computer-science shortcut for “foo as a predicate”.
\ “When I get real bored, I like to drive downtown and get a |
`\ great parking spot, then sit in my car and count how many |
_o__) people ask me if I'm leaving.” —Steven Wright |
More information about the Python-ideas