Esempio n. 1
0
            sage: str(ua)
            ' \u03c0\u22c5x\n\u212f   '
        """
        return repr(self).decode("utf-8")


_unicode_art_factory = CharacterArtFactory(
    UnicodeArt,
    str,
    '_unicode_art_',
    (symbol.unicode_left_parenthesis, symbol.unicode_right_parenthesis),
    (symbol.unicode_left_square_bracket, symbol.unicode_right_square_bracket),
    (symbol.unicode_left_curly_brace, symbol.unicode_right_curly_brace),
)

empty_unicode_art = _unicode_art_factory.build_empty()


def unicode_art(*obj, **kwds):
    r"""
    Return an unicode art representation

    INPUT:


    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.

    - ``sep`` -- optional ``'sep=...'`` keyword argument (or ``'separator'``).
      Anything that can be converted to unicode art (default: empty unicode
      art). The separator in-between a list of objects. Only used if
Esempio n. 2
0
            sage: unicode(ua)  # py2
            u' \u03c0\u22c5x\n\u212f   '
            sage: str(ua)  # py3
            ' \u03c0\u22c5x\n\u212f   '
        """
        return repr(self).decode("utf-8")

_unicode_art_factory = CharacterArtFactory(
    UnicodeArt, text_type, '_unicode_art_',
    (symbol.unicode_left_parenthesis, symbol.unicode_right_parenthesis),
    (symbol.unicode_left_square_bracket, symbol.unicode_right_square_bracket),
    (symbol.unicode_left_curly_brace, symbol.unicode_right_curly_brace),
)


empty_unicode_art = _unicode_art_factory.build_empty()


def unicode_art(*obj, **kwds):
    r"""
    Return an unicode art representation

    INPUT:


    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.

    - ``sep`` -- optional ``'sep=...'`` keyword argument (or ``'separator'``).
      Anything that can be converted to unicode art (default: empty unicode
      art). The separator in-between a list of objects. Only used if
Esempio n. 3
0
        sage: ascii_art(sum(pi^i/factorial(i)*x^i, i, 0, oo))
         pi*x
        e
    """
    _string_type = str


_ascii_art_factory = CharacterArtFactory(
    AsciiArt, str, '_ascii_art_',
    (symbol.ascii_left_parenthesis, symbol.ascii_right_parenthesis),
    (symbol.ascii_left_square_bracket, symbol.ascii_right_square_bracket),
    (symbol.ascii_left_curly_brace, symbol.ascii_right_curly_brace),
)


empty_ascii_art = _ascii_art_factory.build_empty()


def ascii_art(*obj, **kwds):
    r"""
    Return an ASCII art representation

    INPUT:

    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.

    - ``sep`` -- optional ``'sep=...'`` keyword argument (or ``'separator'``).
      Anything that can be converted to ascii art (default: empty ascii
      art). The separator in-between a list of objects. Only used if
      more than one object given.
Esempio n. 4
0
         pi*x
        e
    """
    _string_type = str



_ascii_art_factory = CharacterArtFactory(
    AsciiArt, str, '_ascii_art_',
    (symbol.ascii_left_parenthesis, symbol.ascii_right_parenthesis),
    (symbol.ascii_left_square_bracket, symbol.ascii_right_square_bracket),
    (symbol.ascii_left_curly_brace, symbol.ascii_right_curly_brace),
)


empty_ascii_art = _ascii_art_factory.build_empty()


def ascii_art(*obj, **kwds):
    r"""
    Return an ASCII art representation

    INPUT:

    - ``*obj`` -- any number of positional arguments, of arbitrary
      type. The objects whose ascii art representation we want.

    - ``sep`` -- optional ``'sep=...'`` keyword argument. Anything
      that can be converted to ascii art (default: empty ascii
      art). The separator in-between a list of objects. Only used if
      more than one object given.