circuits.six module

Utilities for writing code that runs on Python 2 and 3

class circuits.six.Iterator

Bases: object

next()
class circuits.six.Module_six_moves_urllib

Bases: module

Create a six.moves.urllib namespace that resembles the Python 3 namespace

error = <module 'circuits.six.moves.urllib.error' (built-in)>
parse = <module 'circuits.six.moves.urllib_parse' (built-in)>
request = <module 'circuits.six.moves.urllib.request' (built-in)>
response = <module 'circuits.six.moves.urllib.response' (built-in)>
robotparser = <module 'circuits.six.moves.urllib.robotparser' (built-in)>
class circuits.six.Module_six_moves_urllib_error(name)

Bases: circuits.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_error

ContentTooShortError
HTTPError
URLError
class circuits.six.Module_six_moves_urllib_parse(name)

Bases: circuits.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_parse

ParseResult
SplitResult
parse_qs
parse_qsl
quote
quote_plus
splitquery
splittag
splituser
splitvalue
unquote
unquote_plus
urldefrag
urlencode
urljoin
urlparse
urlsplit
urlunparse
urlunsplit
uses_fragment
uses_netloc
uses_params
uses_query
uses_relative
class circuits.six.Module_six_moves_urllib_request(name)

Bases: circuits.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_request

AbstractBasicAuthHandler
AbstractDigestAuthHandler
BaseHandler
CacheFTPHandler
FTPHandler
FancyURLopener
FileHandler
HTTPBasicAuthHandler
HTTPCookieProcessor
HTTPDefaultErrorHandler
HTTPDigestAuthHandler
HTTPErrorProcessor
HTTPHandler
HTTPPasswordMgr
HTTPPasswordMgrWithDefaultRealm
HTTPRedirectHandler
HTTPSHandler
OpenerDirector
ProxyBasicAuthHandler
ProxyDigestAuthHandler
ProxyHandler
Request
URLopener
UnknownHandler
build_opener
getproxies
install_opener
pathname2url
proxy_bypass
url2pathname
urlcleanup
urlopen
urlretrieve
class circuits.six.Module_six_moves_urllib_response(name)

Bases: circuits.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_response

addbase
addclosehook
addinfo
addinfourl
class circuits.six.Module_six_moves_urllib_robotparser(name)

Bases: circuits.six._LazyModule

Lazy loading of moved objects in six.moves.urllib_robotparser

RobotFileParser
class circuits.six.MovedAttribute(name, old_mod, new_mod, old_attr=None, new_attr=None)

Bases: circuits.six._LazyDescr

class circuits.six.MovedModule(name, old, new=None)

Bases: circuits.six._LazyDescr

circuits.six.add_metaclass(metaclass)

Class decorator for creating a class with a metaclass.

circuits.six.add_move(move)

Add an item to six.moves.

circuits.six.assertCountEqual(self, *args, **kwargs)
circuits.six.assertRaisesRegex(self, *args, **kwargs)
circuits.six.assertRegex(self, *args, **kwargs)
circuits.six.b(s)

Byte literal

circuits.six.byte2int(bs)
circuits.six.create_bound_method(func, obj)
circuits.six.create_unbound_method(func, cls)
circuits.six.exec_(_code_, _globs_=None, _locs_=None)

Execute code in a namespace.

circuits.six.get_unbound_function(unbound)

Get the function out of a possibly unbound function

circuits.six.indexbytes(buf, i)
circuits.six.iteritems(d, **kw)

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

circuits.six.iterkeys(d, **kw)

Return an iterator over the keys of a dictionary.

circuits.six.iterlists(d, **kw)

Return an iterator over the (key, [values]) pairs of a dictionary.

circuits.six.itervalues(d, **kw)

Return an iterator over the values of a dictionary.

circuits.six.print_(*args, **kwargs)
circuits.six.python_2_unicode_compatible(klass)

A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing.

To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class.

circuits.six.raise_from(value, from_value)
circuits.six.remove_move(name)

Remove item from six.moves.

circuits.six.reraise(tp, value, tb=None)

Reraise an exception.

circuits.six.u(s)

Text literal

circuits.six.with_metaclass(meta, *bases)

Create a base class with a metaclass.

circuits.six.wraps(wrapped, assigned=('__module__', '__name__', '__doc__'), updated=('__dict__', ))