Package pyxb :: Package utils :: Module six
[hide private]
[frames] | no frames]

Module six

source code

Utilities for writing code that runs on Python 2 and 3


Version: 1.5.2

Author: Benjamin Peterson <benjamin@python.org>

Classes [hide private]
text_type
unicode(string [, encoding[, errors]]) -> object
binary_type
str(object) -> string
_LazyDescr
MovedModule
_LazyModule
MovedAttribute
_MovedItems
Lazy loading of moved objects
Module_six_moves_urllib_parse
Lazy loading of moved objects in six.moves.urllib_parse
Module_six_moves_urllib_error
Lazy loading of moved objects in six.moves.urllib_error
Module_six_moves_urllib_request
Lazy loading of moved objects in six.moves.urllib_request
Module_six_moves_urllib_response
Lazy loading of moved objects in six.moves.urllib_response
Module_six_moves_urllib_robotparser
Lazy loading of moved objects in six.moves.urllib_robotparser
Module_six_moves_urllib
Create a six.moves.urllib namespace that resembles the Python 3 namespace
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
 
create_bound_method(func, obj) source code
 
callable(obj) source code
 
iterkeys(d, **kw)
Return an iterator over the keys of a dictionary.
source code
 
itervalues(d, **kw)
Return an iterator over the values of a dictionary.
source code
 
iteritems(d, **kw)
Return an iterator over the (key, value) pairs of a dictionary.
source code
 
iterlists(d, **kw)
Return an iterator over the (key, [values]) pairs of a dictionary.
source code
 
b(s) source code
 
u(s) source code
character
unichr(i)
Return a string of one character with ordinal i; 0 <= i < 256.
character
int2byte(i)
Return a string of one character with ordinal i; 0 <= i < 256.
 
byte2int(bs) source code
 
indexbytes(buf, i) source code
 
iterbytes(buf) source code
 
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 for Python 2.4 and 2.5.
source code
 
with_metaclass(meta, *bases)
Create a base class with a metaclass.
source code
 
add_metaclass(metaclass)
Class decorator for creating a class with a metaclass.
source code
 
unicode_convertible(clazz) source code
Variables [hide private]
  PY2 = sys.version_info [0]== 2
  PY3 = sys.version_info [0]== 3
  string_types = basestring,
  integer_types = int, long
  class_types = type, types.ClassType
  none_type = types.NoneType
  boolean_type = types.BooleanType
  int_type = types.IntType
  long_type = types.LongType
  float_type = types.FloatType
  list_type = types.ListType
  tuple_type = types.TupleType
  dictionary_type = types.DictionaryType
  MAXSIZE = int((1 << 63)-1)
  _moved_attributes = [MovedAttribute("cStringIO", "cStringIO", ...
  moves
  _urllib_parse_moved_attributes = [MovedAttribute("ParseResult"...
  _urllib_error_moved_attributes = [MovedAttribute("URLError", "...
  _urllib_request_moved_attributes = [MovedAttribute("urlopen", ...
  _urllib_response_moved_attributes = [MovedAttribute("addbase",...
  _urllib_robotparser_moved_attributes = [MovedAttribute("RobotF...
  _meth_func = "im_func"
  _meth_self = "im_self"
  _func_closure = "func_closure"
  _func_code = "func_code"
  _func_defaults = "func_defaults"
  _func_globals = "func_globals"
  _iterkeys = "iterkeys"
  _itervalues = "itervalues"
  _iteritems = "iteritems"
  _iterlists = "iterlists"
  get_method_function = operator.attrgetter(_meth_func)
  get_method_self = operator.attrgetter(_meth_self)
  get_function_closure = operator.attrgetter(_func_closure)
  get_function_code = operator.attrgetter(_func_code)
  get_function_defaults = operator.attrgetter(_func_defaults)
  get_function_globals = operator.attrgetter(_func_globals)
  BytesIO = StringIO.StringIO
  StringIO = StringIO.StringIO
  intern = __builtin__.intern
  file = __builtin__.file
Variables Details [hide private]

_moved_attributes

Value:
[MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), MovedAttr\
ibute("filter", "itertools", "builtins", "ifilter", "filter"), MovedAt\
tribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filt\
erfalse"), MovedAttribute("input", "__builtin__", "builtins", "raw_inp\
ut", "input"), MovedAttribute("map", "itertools", "builtins", "imap", \
"map"), MovedAttribute("range", "__builtin__", "builtins", "xrange", "\
range"), MovedAttribute("reload_module", "__builtin__", "imp", "reload\
"), MovedAttribute("reduce", "__builtin__", "functools"), MovedAttribu\
...

_urllib_parse_moved_attributes

Value:
[MovedAttribute("ParseResult", "urlparse", "urllib.parse"), MovedAttri\
bute("parse_qs", "urlparse", "urllib.parse"), MovedAttribute("parse_qs\
l", "urlparse", "urllib.parse"), MovedAttribute("urldefrag", "urlparse\
", "urllib.parse"), MovedAttribute("urljoin", "urlparse", "urllib.pars\
e"), MovedAttribute("urlparse", "urlparse", "urllib.parse"), MovedAttr\
ibute("urlsplit", "urlparse", "urllib.parse"), MovedAttribute("urlunpa\
rse", "urlparse", "urllib.parse"), MovedAttribute("urlunsplit", "urlpa\
rse", "urllib.parse"), MovedAttribute("quote", "urllib", "urllib.parse\
...

_urllib_error_moved_attributes

Value:
[MovedAttribute("URLError", "urllib2", "urllib.error"), MovedAttribute\
("HTTPError", "urllib2", "urllib.error"), MovedAttribute("ContentTooSh\
ortError", "urllib", "urllib.error"),]

_urllib_request_moved_attributes

Value:
[MovedAttribute("urlopen", "urllib2", "urllib.request"), MovedAttribut\
e("install_opener", "urllib2", "urllib.request"), MovedAttribute("buil\
d_opener", "urllib2", "urllib.request"), MovedAttribute("pathname2url"\
, "urllib", "urllib.request"), MovedAttribute("url2pathname", "urllib"\
, "urllib.request"), MovedAttribute("getproxies", "urllib", "urllib.re\
quest"), MovedAttribute("Request", "urllib2", "urllib.request"), Moved\
Attribute("OpenerDirector", "urllib2", "urllib.request"), MovedAttribu\
te("HTTPDefaultErrorHandler", "urllib2", "urllib.request"), MovedAttri\
...

_urllib_response_moved_attributes

Value:
[MovedAttribute("addbase", "urllib", "urllib.response"), MovedAttribut\
e("addclosehook", "urllib", "urllib.response"), MovedAttribute("addinf\
o", "urllib", "urllib.response"), MovedAttribute("addinfourl", "urllib\
", "urllib.response"),]

_urllib_robotparser_moved_attributes

Value:
[MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"\
),]