Skip to content

Prevent string and dictionary truncation #59

@l3ender

Description

@l3ender

I've noticed the following when using q:

  • long strings are abbreviated with ... in the middle.
  • dictionary objects with greater than 10 entries print the first 10 and then truncate the rest using ....

Example:

obj = {"my_key": {"aaa": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et hendrerit ante. Aliquam iaculis magna sed ipsum scelerisque porttitor.", "bbb": "2", "ccc": "3", "ddd": "4", "eee": "5", "fff": "6", "ggg": "7", "hhh": "8", "iii": "9", "jjj": "10", "kkk": "11"}}
q(obj)

# output:
{'my_key': {'aaa': 'Lorem ipsum dolor sit amet, consectetur adipisci...am iaculis magna sed ipsum scelerisque porttitor.', 'bbb': '2', 'ccc': '3', 'ddd': '4', 'eee': '5', 'fff': '6', 'ggg': '7', 'hhh': '8', 'iii': '9', 'jjj': '10', ...}}

Is there a way to prevent it? I'm not very proficient in python so my apologies if this is a simple question. Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions