'Constructor.
We only accept unicode and str instances, the latter with encoding.
Args:
arg: optional unicode or str instance; default u\'\'
encoding: optional encoding; disallowed when isinstance(arg, unicode),
defaults to \'ascii\' when isinstance(arg, str);'

def __new__(cls, arg=None, encoding=None):

    if (arg is None):
        arg = u''
    if isinstance(arg, unicode):
        if (encoding is not None):
            raise TypeError('Text()    with    a    unicode    argument    should    not    specify    an    encoding')
        return super(Text, cls).__new__(cls, arg)
    if isinstance(arg, str):
        if (encoding is None):
            encoding = 'ascii'
        return super(Text, cls).__new__(cls, arg, encoding)
    raise TypeError(('Text()    argument    should    be    str    or    unicode,    not    %s' % type(arg).__name__))
