[Python-ideas] What about allowing '?' in method names?
contact at xavierho.com
Thu Aug 6 10:30:14 CEST 2009
On Thu, Aug 6, 2009 at 6:10 PM, Tennessee Leeuwenburg <
tleeuwenburg at gmail.com> wrote:
> Well, probably everyone will want to do things differently. Not all method
> names work with an 'is' stuck on the front, or a 'Flag' stuck on the end...
> 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.
> Also, when working with someone else's code, they may already has isFoo()
> style methods which don't return flags.
> So Q is good enough for me, but ? would be even better, for me.
It's cool, I'd like to know what others think about it. Although I don't
think many would agree with you, as this is more of a personal style thing.
Q looks good, and obvious. Or you could resort to the traditional style
where b_ prefix seemed to be loved by many C programmers. Hmm.
isXX and hasXXX still work for me well though.
Take it easy,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas