Skip to content

print does not work as expected #542

Open
@qingyunha

Description

@qingyunha

In branch 2.0. I run the example of docstring

from __future__ import unicode_literals
from prompt_toolkit import print
from prompt_toolkit.styles import Style

style = Style.from_dict({
    'hello': '#ff0066',
    'world': '#884444 italic',
})
fragments = [
('class:hello', 'Hello'),
('class:world', 'World'),
]
print(fragments, style=style)

output

[('class:hello', 'Hello'), ('class:world', 'World')]

But when I commented the two lines, it work

 66     # Merges values.
 67     def to_text(val):
 68         # if isinstance(val, list):
 69             # return to_formatted_text('{0}'.format(val))
 70         return to_formatted_text(val, auto_convert=True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions