Package PyFoam :: Package ThirdParty :: Module six
[hide private]
[frames] | no frames]

Module six

source code

Utilities for writing code that runs on Python 2 and 3


Version: 1.2.0

Author: Benjamin Peterson <benjamin@python.org>

Classes [hide private]
  text_type
unicode(string [, encoding[, errors]]) -> object
  binary_type
str(object) -> string
  _LazyDescr
  MovedModule
  MovedAttribute
  _MovedItems
Lazy loading of moved objects
  Iterator
Functions [hide private]
 
_add_doc(func, doc)
Add documentation to a function.
source code
 
_import_module(name)
Import module, returning the module after the last dot.
source code
 
add_move(move)
Add an item to six.moves.
source code
 
remove_move(name)
Remove item from six.moves.
source code
 
advance_iterator(it) source code
 
next(it) source code
 
get_unbound_function(unbound) source code
 
callable(obj) source code
 
iterkeys(d)
Return an iterator over the keys of a dictionary.
source code
 
itervalues(d)
Return an iterator over the values of a dictionary.
source code
 
iteritems(d)
Return an iterator over the (key, value) pairs of a dictionary.
source code
 
b(s) source code
 
u(s) source code
character
int2byte(i)
Return a string of one character with ordinal i; 0 <= i < 256.
 
reraise(tp, value, tb=None) source code
 
exec_(code, globs=None, locs=None)
Execute code in a namespace.
source code
 
print_(*args, **kwargs)
The new-style print function.
source code
 
with_metaclass(meta, base=object)
Create a base class with a metaclass.
source code
Variables [hide private]
  PY3 = sys.version_info [0]== 3
  string_types = basestring,
  integer_types = int, long
  class_types = type, types.ClassType
  MAXSIZE = int((1 << 63)-1)
  _moved_attributes = [MovedAttribute("cStringIO", "cStringIO", ...
  moves
  _meth_func = "im_func"
  _meth_self = "im_self"
  _func_code = "func_code"
  _func_defaults = "func_defaults"
  _iterkeys = "iterkeys"
  _itervalues = "itervalues"
  _iteritems = "iteritems"
  get_method_function = operator.attrgetter(_meth_func)
  get_method_self = operator.attrgetter(_meth_self)
  get_function_code = operator.attrgetter(_func_code)
  get_function_defaults = operator.attrgetter(_func_defaults)
  BytesIO = StringIO.StringIO
  StringIO = StringIO.StringIO
Variables Details [hide private]

_moved_attributes

Value:
[MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), MovedAttr\
ibute("filter", "itertools", "builtins", "ifilter", "filter"), MovedAt\
tribute("input", "__builtin__", "builtins", "raw_input", "input"), Mov\
edAttribute("map", "itertools", "builtins", "imap", "map"), MovedAttri\
bute("reload_module", "__builtin__", "imp", "reload"), MovedAttribute(\
"reduce", "__builtin__", "functools"), MovedAttribute("StringIO", "Str\
ingIO", "io"), MovedAttribute("xrange", "__builtin__", "builtins", "xr\
ange", "range"), MovedAttribute("zip", "itertools", "builtins", "izip"\
...