On Sat, Sep 20, 2014 at 4:18 PM, Noufal Ibrahim KV <nou...@nibrahim.net.in>
wrote:

> On Sat, Sep 20 2014, Harish Vishwanath wrote:
>
> > Couple of approaches:
> >
> > - Break the api into two. get_stats and get_stats_consolidated. This way,
> > the caller who doesn't know what is your default value of "consolidated"
> > argument is will not be confused.
>
> This explodes the API. It's similar to having two sort functions
> 'sort_increasing', and 'sort_decreasing' instead of just a single sort
> function with a flag to indicate ordering.


I think the comparison is not strictly apples to apples. In case of sort
ascending / descending flag parameterises the same sort algorithm. In your
case, you do some additional things (loop through and add up stuff,
perhaps) based on the value of the flag. That is very different.
_______________________________________________
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers

Reply via email to