virttest.staging.backports package

Module contents

This module contains backported functions that are not present in Python 2.4 but are standard in more recent versions.

virttest.staging.backports.all(iterable)

From http://stackoverflow.com/questions/3785433/python-backports-for-some-methods :codeauthor: Tim Pietzcker http://stackoverflow.com/users/20670/tim-pietzcker licensed under cc-wiki with attribution required

virttest.staging.backports.any(iterable)

From http://stackoverflow.com/questions/3785433/python-backports-for-some-methods :codeauthor: Tim Pietzcker http://stackoverflow.com/users/20670/tim-pietzcker licensed under cc-wiki with attribution required

virttest.staging.backports.bin(number)

Adapted from http://code.activestate.com/recipes/576847/ :codeauthor: Vishal Sapre :license: MIT

A foolishly simple look-up method of getting binary string from an integer This happens to be faster than all other ways!!!

virttest.staging.backports.next(*args)

Retrieve the next item from the iterator by calling its next() method. If default is given, it is returned if the iterator is exhausted, otherwise StopIteration is raised. New in version 2.6.

Parameters:
  • iterator (iterator) – the iterator
  • default (object) – the value to return if the iterator raises StopIteration
Returns:

The object returned by iterator.next()

Return type:

object