packages.six

Utilities for writing code that runs on Python 2 and 3

Module Contents

Classes

X()
_LazyDescr(self,name)
MovedModule(self,name,old,new=None)
MovedAttribute(self,name,old_mod,new_mod,old_attr=None,new_attr=None)
_MovedItems() Lazy loading of moved objects
Iterator()

Functions

_add_doc(func,doc) Add documentation to a function.
_import_module(name) Import module, returning the module after the last dot.
add_move(move) Add an item to six.moves.
remove_move(name) Remove item from six.moves.
advance_iterator(it)
get_unbound_function(unbound)
callable(obj)
get_unbound_function(unbound)
iterkeys(d) Return an iterator over the keys of a dictionary.
itervalues(d) Return an iterator over the values of a dictionary.
iteritems(d) Return an iterator over the (key, value) pairs of a dictionary.
b(s)
u(s)
int2byte(i)
b(s)
u(s)
reraise(tp,value,tb=None)
exec_(code,globs=None,locs=None) Execute code in a namespace.
print_(*args,**kwargs) The new-style print function.
with_metaclass(meta,base=object) Create a base class with a metaclass.
class X
__len__()
_add_doc(func, doc)

Add documentation to a function.

_import_module(name)

Import module, returning the module after the last dot.

class _LazyDescr(name)
__init__(name)
__get__(obj, tp)
class MovedModule(name, old, new=None)
__init__(name, old, new=None)
_resolve()
class MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)
__init__(name, old_mod, new_mod, old_attr=None, new_attr=None)
_resolve()
class _MovedItems

Lazy loading of moved objects

add_move(move)

Add an item to six.moves.

remove_move(name)

Remove item from six.moves.

advance_iterator(it)
get_unbound_function(unbound)
callable(obj)
get_unbound_function(unbound)
class Iterator
next()
iterkeys(d)

Return an iterator over the keys of a dictionary.

itervalues(d)

Return an iterator over the values of a dictionary.

iteritems(d)

Return an iterator over the (key, value) pairs of a dictionary.

b(s)
u(s)
int2byte(i)
b(s)
u(s)
reraise(tp, value, tb=None)
exec_(code, globs=None, locs=None)

Execute code in a namespace.

print_(*args, **kwargs)

The new-style print function.

with_metaclass(meta, base=object)

Create a base class with a metaclass.