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

use C3 MRO if called for via envvar EXTENSIONCLASS_C3_MRO #34

Closed
wants to merge 15 commits into from

Conversation

d-maurer
Copy link

This PR lets the envvar EXTENSIONCLASS_C3_MRO control whether ExtensionClass uses Python's C3 method resolution order or continues to use the old classic one (that from Python's "old style classes"). If defined the value must be an integer and is used as boolean.

During the test (using the Zope tests) I hit several examples which gave me the impression that the C3 MRO is far less intuitive than the classic one. In easy cases, the problem manifested itself at class definition time (TypeError: cannot determine a consistent resolution error); however, sometimes, it manifested itself in subtle behavior change. It took me considerable effort to rearrange the class hierarchy in those cases. I expect that other applications, too, would require considerable class hierarchy restructuring to use the C3 MRO.

@d-maurer d-maurer requested review from icemac and jamadden June 23, 2021 06:07
@icemac
Copy link
Member

icemac commented Jun 23, 2021

I added testing the C3 variant to tox and GHA. Locally the tests fail on Python 2.7.

@icemac
Copy link
Member

icemac commented Jun 23, 2021

I added testing the C3 variant to tox and GHA. Locally the tests fail on Python 2.7.

This is not correct (yet): The GHA configuration is currently ignored by the meta/config script.

@icemac
Copy link
Member

icemac commented Jun 23, 2021

But I added the necessary configuration directly to the GHA config.

@icemac
Copy link
Member

icemac commented Apr 14, 2022

The experiment was abandoned in zopefoundation/Zope#982. Keeping the changes here for the record.

@icemac icemac closed this Apr 14, 2022
@icemac icemac deleted the experimental_C3_MRO branch April 14, 2022 06:10
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.

None yet

2 participants