Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(2)  |  Derive(0)  |  Import(6)
unicode(object='') -> unicode object
unicode(string[, encoding[, errors]]) -> unicode object

Create a new Unicode object from the given encoded string.
encoding defaults to the current default string encoding.
errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'.

src/x/o/xoutil-1.5.4/xoutil/string.py   xoutil(Download)
 
from xoutil.deprecation import deprecated as _deprecated
from xoutil.six import (string_types as _str_base,
                        text_type as _unicode,
                        binary_type as _bytes,
            # In Python 3 str(b'm') returns the string "b'm'" and not just "m",
            # this fixes this.
            return _unicode(s, encoding, 'replace')
        except:
            # For numbers and other stuff.
            return _unicode(s)

src/x/o/xoutil-1.5.4/xoutil/pprint.py   xoutil(Download)
    '''
    import io
    from xoutil.six import PY3, text_type
    if PY3:
        stream = io.StringIO()

src/x/o/xoutil-1.5.4/xoutil/html/__init__.py   xoutil(Download)
 
        """
        from xoutil.six import text_type
        from xoutil.string import safe_decode, safe_encode
        if not isinstance(s, text_type):

src/x/o/xoutil-1.5.4/xoutil/cli/tools.py   xoutil(Download)
    res = getattr(cls, 'command_cli_name', Unset)
    if res is not Unset:
        from xoutil.six import text_type
        if not isinstance(res, text_type):
            raise TypeError("Attribute 'command_cli_name' must be a string.")

src/x/o/xoutil-1.5.4/tests/test_pprint.py   xoutil(Download)
def test_ppformat_rtype():
    from xoutil.pprint import ppformat
    from xoutil.six import text_type
    o = [list(range(i+1)) for i in range(10)]
    assert type(ppformat(o)) is text_type

src/x/o/xoutil-1.5.4/tests/test_annotations.py   xoutil(Download)
def test_mixed_annotations():
    from xoutil.six import text_type
 
    @annotate('(a: str, b:text_type) -> bool', a=text_type,
              return_annotation=True)