Skip to content

Conversation

@bbonenfant
Copy link

@bbonenfant bbonenfant commented Oct 25, 2020

This makes the pprint.pformat perform the default ordering on all set and frozenset objects. This was determined to be a bug, since these objects are ordered if they violate the maximum width of the output, but was never fixed.

Reference: https://bugs.python.org/issue27495

https://bugs.python.org/issue27495

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@bbonenfant

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Lib/pprint.py Outdated
del context[objid]
return format % ", ".join(components), readable, recursive

if (issubclass(typ, set) and r is set.__repr__) or \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but this block is almost a complete duplicate of the one above (please fix that).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have merged this section with the above one. Please let me know if this is satisfactory. I originally separated them to follow the layout of the function and separate out new code from old code.

@github-actions
Copy link

github-actions bot commented Jan 5, 2021

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 5, 2021
@tyates-indeed
Copy link

I would like to see this get merged in. Is there anything I can do to help get this merged?

Copy link
Contributor

@MaxwellDupre MaxwellDupre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see test results say:
Ran 35 tests in 0.123s
OK (expected failures=1)
Looks ok to me.

@github-actions github-actions bot removed the stale Stale PR or inactive for long period of time. label Jul 30, 2022
@rhattersley
Copy link

Looks like the only merge conflict is both "Ben Bonenfant" and "David Bonner" have been added to the Misc/ACKS file so it should be trivial to resolve. It'd be great if someone with the relevant permissions could get this in, thanks. 👍

@arhadthedev arhadthedev changed the title bpo-27495: Make pprint.pformat always order sets gh-71682: Make pprint.pformat always order sets Feb 21, 2023
@arhadthedev arhadthedev added the stdlib Standard Library Python modules in the Lib/ directory label Feb 21, 2023
@arhadthedev
Copy link
Member

@freddrake could you merge this PR if feasible, please (as a pprint expert and a core dev)?

Copy link
Contributor

@furkanonder furkanonder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devdanzin
Copy link
Member

As a bugfix, can this still land in 3.13?

@bbonenfant
Copy link
Author

I appreciate the continued interest in this PR. I'm happy to do whatever is necessary to get this merged, but I'm not sure what else I can do besides wait for a core team member to give it review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review stdlib Standard Library Python modules in the Lib/ directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.