[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2016-05-06 Thread Berker Peksag
Berker Peksag added the comment: statistics_as_integer_ratio.diff has been committed in 7b2fafd78c1d. -- nosy: +berker.peksag resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2016-04-03 Thread Stefan Krah
Stefan Krah added the comment: Ping. Just a reminder that it would be nice to get this into 3.6-alpha-1. :) -- ___ Python tracker ___

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I believe the current code is well-weighed compromise that optimize different cases ranged for their frequency of occurrence (floats, ints, decimals, fractions, subclasses of int, float, etc and independed numeric types). And new addition unlikely will chang

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: The clear winner for float and Decimal is hasattr(x, 'as_integer_ratio'). The other types are a bit disadvantaged if the lookup fails, but they go through additional try/excepts anyway. -- ___ Python tracker

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: No, I haven't done any benchmarks. In a quick test type(x) == float does not seem any faster than isinstance(x, float), so perhaps we could reduce the try/except complexity. -- ___ Python tracker

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. I haven't tested that "type(x) is float or type(x) is Decimal" is faster than alternatives ("type(x) in (float, Decimal)", or "isinstance(x, (float, Decimal))", or "hasattr(x, 'as_integer_ratio')") and believe you have tested this. -- stage:

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
New submission from Stefan Krah: Here's a fix for the fallout from #25928. I've set it to release blocker to make sure we don't forget. -- assignee: steven.daprano components: Library (Lib) files: statistics_as_integer_ratio.diff keywords: 3.5regression, patch messages: 257178 nosy: bel