[issue19763] Make it easier to backport statistics to 2.7
Christian Heimes
report at bugs.python.org
Mon Nov 25 08:31:36 CET 2013
New submission from Christian Heimes:
A while ago I created a backport of statistics to Python 2.6 to 3.3. [1] It worked pretty and required just a few modifications to the code. I'd like to add most modifications to 3.4 to simplify backporting.
The modifications are:
* from __future__ import division
* replace super() with super(MySuperClass, self)
* changes to doc tests because Python 2 has slightly different represenstations (<type 'float'> / <class'float'>, longer float repr)
* "import collections" -> "from collections import Counter" so I can simply add a Counter class for 2.6
* "import math" -> "from math import isfinite" so it's easier to add a isfinite() function for 2.x
The patch does neither remove "raise ... from None" nor does it add a 2.x isfinite or range = xrange. The backport still needs some patches but I can keep the amount of changes rather small.
[1] https://bitbucket.org/tiran/backports.statistics
----------
files: statistics_backports.patch
keywords: patch
messages: 204301
nosy: christian.heimes, larry
priority: normal
severity: normal
stage: patch review
status: open
title: Make it easier to backport statistics to 2.7
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file32829/statistics_backports.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19763>
_______________________________________
More information about the Python-bugs-list
mailing list