Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Width argument not respected when set to large value #67

Open
frnhr opened this issue Aug 10, 2019 · 1 comment
Open

Width argument not respected when set to large value #67

frnhr opened this issue Aug 10, 2019 · 1 comment

Comments

@frnhr
Copy link

frnhr commented Aug 10, 2019

  • PrettyPrinter version: 0.18.0
  • Python version: 3.7.4
  • Operating System: MacOS 10.14.6

Description

I want to print a simple dict with long str values without line wrapping.

What I Did

Screenshot 2019-08-10 at 19 30 56

Expected:

{
    'foo': 'a very long bar a very long bar a very long bar a very long bar a very long bar a very long bar ',
    # 'baz': 'if there were other keys, they would be here...',
}
@slw07g
Copy link

slw07g commented Sep 20, 2019

Noticed this as well, looking at the pprint() definition, this might be working a intended:

   :param indent: number of spaces to add for each level of nesting.
   :param stream: the output stream, defaults to ``sys.stdout``
   :param width: a soft maximum allowed number of columns in the output,
                 which the layout algorithm attempts to stay under.
   :param depth: maximum depth to print nested structures
   :param ribbon_width: a soft maximum allowed number of columns in the output,
                        after indenting the line
   :param max_seq_len: a maximum sequence length that applies to subclasses of
                       lists, sets, frozensets, tuples and dicts. A trailing
                       comment that indicates the number of truncated elements.
                       Setting max_seq_len to ``None`` disables truncation.
   :param sort_dict_keys: a ``bool`` value indicating if dict keys should be
                          sorted in the output. Defaults to ``False``, in
                          which case the default order is used, which is the
                          insertion order in CPython 3.6+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants