/usr/share/pyshared/uncertainties/backport.py is in python-uncertainties 2.4.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """
Partial back-port of functions for older versions of Python.
This module is intended to be imported as 'from backport import *'.
in fact, this does not redefine any, all, etc. if they already exist.
Furthermore, no program must depend on backport.* functions.
"""
import sys
# For Python < 2.5:
if sys.version_info < (2, 5):
def any(iterable):
for element in iterable:
if element:
return True
return False
def all(iterable):
for element in iterable:
if not element:
return False
return True
if sys.version_info < (2, 4):
def reversed(sequence):
return sequence[::-1]
from sets import Set as set
|