Author mark.dickinson
Recipients agthorr, belopolsky, christian.heimes, gregory.p.smith, mark.dickinson, pitrou, ronaldoussoren, steven.daprano, stutzbach, tshepang, vajrasky
Date 2013-08-05.18:57:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> My only objection is to having a class xyz such that isinstance(xyz(..),
> xyz) is false.

Yep.  Use a set of functions (median, median_low);  use an instance of a class as Alexander describes;  use a single median function that takes an optional "method" parameter;  create a statistics.median subpackage and put the various median functions in that.  Any of those options are fairly standard, unsurprising, and could reasonably be defended.

But having `median` be a class whose `__new__` returns a float really *is* nonstandard and peculiar.  There's just no need for such perversity in what should be a straightforward and uncomplicated module.  Special cases aren't special enough to break the rules and all that.
Date User Action Args
2013-08-05 18:57:19mark.dickinsonsetrecipients: + mark.dickinson, gregory.p.smith, ronaldoussoren, belopolsky, pitrou, agthorr, christian.heimes, stutzbach, steven.daprano, tshepang, vajrasky
2013-08-05 18:57:19mark.dickinsonsetmessageid: <>
2013-08-05 18:57:19mark.dickinsonlinkissue18606 messages
2013-08-05 18:57:19mark.dickinsoncreate