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

Fix repr() checks for Python 3.10 #1254

Closed
wants to merge 1 commit into from

Conversation

eclipseo
Copy link
Contributor

Stating Python 3.10 alpha 7, repr() was modified as follow:

bpo-40066: Enum: adjust repr() to show only enum and member name
(not value, nor angle brackets) and str() to show only member name.
Update and improve documentation to match.

bpo-40066: Enum’s repr() and str() have changed: repr() is
now EnumClass.MemberName and str() is MemberName. Additionally,
stdlib Enum’s whose contents are available as module attributes,
such as RegexFlag.IGNORECASE, have their repr() as module.name,
e.g. re.IGNORECASE.

See https://bugs.python.org/issue40066

This commit fixes the assertions to match the new repr() behavior.

Fix #1253

Stating Python 3.10 alpha 7, repr() was modified as follow:

bpo-40066: Enum: adjust repr() to show only enum and member name
(not value, nor angle brackets) and str() to show only member name.
Update and improve documentation to match.

bpo-40066: Enum’s repr() and str() have changed: repr() is
now EnumClass.MemberName and str() is MemberName. Additionally,
stdlib Enum’s whose contents are available as module attributes,
such as RegexFlag.IGNORECASE, have their repr() as module.name,
e.g. re.IGNORECASE.

See https://bugs.python.org/issue40066

This commit fixes the assertions to match the new repr() behavior.

Fix python-hyper#1253
@Kriechi
Copy link
Member

Kriechi commented Apr 15, 2021

Thanks for sending this PR and trying to fix this new backward-incompatible change in the upcoming Python 3.10.

Unfortunately - since it is backward-incompatible - we can't merge this as it would break on all older versions as well. The tests in CI already fail, so we need a smarter approach to get this right. Assuming this change to py3.10 doesn't get reverted - I see there are already quite a few complaints on the bug tracker. If they really move forward with this change, we might need to introduce such an ugly workaround as in pytest-dev/pytest#8540, but I want to "wait and see" first.

@Kriechi Kriechi closed this Apr 15, 2021
@hroncok
Copy link
Contributor

hroncok commented Jul 19, 2021

Assuming this change to py3.10 doesn't get reverted

It got reverted.

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

Successfully merging this pull request may close these issues.

H2 and Python 3.10a7: test failures due to changes in repr()
3 participants