pytest
pytest copied to clipboard
Implement PEP 302 optional get_code loader method
We implement the optional get_code loader method. This increases compatibility with other tools/libraries that need to manipulate the code object of a module before it is executed.
unless there is a compelling example where this helps im opposed to the change as it introduces fragile state just to introduce one optional old method
unless there is a compelling example where this helps
Here's one concrete example where we have to work around this https://github.com/DataDog/dd-trace-py/pull/12812
optional old method
I'm not sure I understand the meaning of "old" here 🤔 . I think implementing this method is good courtesy to other libraries that might have the need to interact with the code object. Here pytest is making the assumption that it is the only tool to manipulate code object, and therefore feels no need to implement get_code.
please understand that composing a PR about a import behavior changes in the github ux that adds state that may be fragile in multiple steps wit errors and without providing background for the need creates a bias