[issue34798] pprint ignores the compact parameter for dicts

2021-12-11 Thread Irit Katriel
Irit Katriel added the comment: Don't discuss on a closed issue. Create a new one if there is still a problem. -- ___ Python tracker ___

[issue34798] pprint ignores the compact parameter for dicts

2021-12-11 Thread Matt Bogosian
Matt Bogosian added the comment: Please consider highlighting that dicts are not included in the documentation. While *technically* true, this ... > compact impacts the way that long sequences (lists, tuples, sets, etc) are > formatted. If compact is false (the default) then each item of a

[issue34798] pprint ignores the compact parameter for dicts

2021-10-25 Thread Ian
Ian added the comment: I came across this and was confused by it too. I also don't understand the justification with not having dicts to be affected by the `compact` parameter. If the "compact form" is having separate entries or elements on one line, instead of having each element separated

[issue34798] pprint ignores the compact parameter for dicts

2021-07-02 Thread Irit Katriel
Change by Irit Katriel : -- versions: -Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34798] pprint ignores the compact parameter for dicts

2021-07-02 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34798] pprint ignores the compact parameter for dicts

2021-07-02 Thread Irit Katriel
Irit Katriel added the comment: New changeset 42c26282a123d14591e1aa31107e566b302a19ac by Miss Islington (bot) in branch '3.10': bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru… (GH-26967) (GH-26990)

[issue34798] pprint ignores the compact parameter for dicts

2021-07-02 Thread Irit Katriel
Irit Katriel added the comment: New changeset 943e77d42d3f84b581f32c05f1fc8c05366b8ed3 by Irit Katriel in branch 'main': bpo-34798: [doc] clearer presentation of pprint.PrettyPrinter constru… (GH-26967) https://github.com/python/cpython/commit/943e77d42d3f84b581f32c05f1fc8c05366b8ed3

[issue34798] pprint ignores the compact parameter for dicts

2021-07-02 Thread miss-islington
Change by miss-islington : -- nosy: +miss-islington nosy_count: 5.0 -> 6.0 pull_requests: +25552 pull_request: https://github.com/python/cpython/pull/26990 ___ Python tracker

[issue34798] pprint ignores the compact parameter for dicts

2021-06-30 Thread Irit Katriel
Irit Katriel added the comment: I made PR26967 to break up the paragraph about the constructor params so that it's easier to read, and also added emphasis around the "sequence" point. -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.8

[issue34798] pprint ignores the compact parameter for dicts

2021-06-30 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +patch pull_requests: +25531 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26967 ___ Python tracker ___

[issue34798] pprint ignores the compact parameter for dicts

2020-09-19 Thread Irit Katriel
Change by Irit Katriel : -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker ___ ___

[issue34798] pprint ignores the compact parameter for dicts

2020-08-22 Thread Irit Katriel
Irit Katriel added the comment: > At the very least it should be made clear in the documentation that dicts are > not compacted. According to https://docs.python.org/3/library/pprint.html compact impacts the way that sequences are displayed, and a dict is not a sequence. So I'm not sure a

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug
Nicolas Hug added the comment: Thanks for the link, But I don't see any justification for this behavior*? Why should lists be compacted but not dicts (even when explicitly asked)? At the very least it should be made clear in the documentation that dicts are not compacted. * Maybe there's

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks much Serhiy for the details! -- ___ Python tracker ___ ___ Python-bugs-list

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is on purpose. See issue19132. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug
Nicolas Hug added the comment: Sorry: [2] https://github.com/scikit-learn/scikit-learn/pull/11705/files#diff-f83e8d9362766b385472f1be7fed9482R96 -- ___ Python tracker ___

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug
Nicolas Hug added the comment: Thank you for the feedback! I'll try the python-ideas mail list. I posted a message on Python-list [1] a few weeks ago but it didn't get much traction. I'm not sure about what the final solution could be (if any), but I had to hack pprint myself [2] for the

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug
Change by Nicolas Hug : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the report Nicolas. I looked into the code and it seems that pprint for a dictionary now doesn't really take compact into account. List, sets, tuple and dequeue use _format_items [0] that honors value of compact but dictionary

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34798] pprint ignores the compact parameter for dicts

2018-09-25 Thread Nicolas Hug
New submission from Nicolas Hug : Dict representations that exceed the line width are printed with one line per key-value pair, ignoring the compact=True parameter: >>> pprint.pprint({i: 0 for i in range(15)}, compact=True) {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 0, 9: 0,