[Python-ideas] Boolean parameters guidelines
Nick Coghlan
ncoghlan at gmail.com
Sun May 8 09:16:34 EDT 2016
On 8 May 2016 at 23:08, Eric V. Smith <eric at trueblade.com> wrote:
> On 5/8/2016 8:14 AM, Nick Coghlan wrote:
> ...
>
>> 2. If the boolean toggle is expected to be constant for any given
>> call-site, consider defining two different functions (e.g.
>> statistics.variance vs statistics.pvariance)
>
> Wouldn't that be "for every (or almost every) call-site"? Surely a few
> constants here and there are okay, it's when parameters are constants
> almost everywhere that the guidance comes in to play.
Aye, that's a better way of phrasing it (it's what I meant, but I can
see how "any given" could be read as "at least one", rather than "if
you select a call site at random, it will be using a constant value").
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-ideas
mailing list