Add unbounded pointer depth in pure Python 3.7+
Leverages module-level __getattr__ as introduced in PEP 562 (Python 3.7+) to enable unbounded depth on pointers in interpreted Python based on their names; i.e. from cython import ppppppp_int will now be valid.
BTW, the fact that travis is unhappy is unrelated to this PR. Would be nice if you could rebase it on latest master.
Any update on this?
@scoder I have been on holiday for the past two weeks with limited access to my laptop and wifi. I will update the PR as soon as I get back.
In the meantime, I think this should come with a test as well. I presume that this fits best under tests/run, correct?
On Fri, Aug 31, 2018 at 10:29 scoder [email protected] wrote:
Any update on this?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/cython/cython/pull/2571#issuecomment-417592068, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab0F0zKTZeKbUOAkg1Thw8DUJKGJxGP6ks5uWPPUgaJpZM4WIbNO .
All fine, no rush, just wanted to check back.
Yep, runnable tests go into tests/run/. Specifically, the pure* tests would be relevant examples here since they are executed in both Cython and Python. You can exclude older Python versions from running the pure Python tests by adding a pure3.7 tag at the top, which also suggests that this would best be a test on its own, just name it pure_py37.py then.
@scoder I'll try looking into it. Can you give me some guidance on the work thats already done and what needs to be done. I would be really thankful. 👍
Instead of using lru_cache, you could just add the constructed pointers to the global namespace. That way future lookups will grab the new attribute and bypass __getattr__ entirely.
@TeamSpen210, sounds good. @HSR05, the test needs fixing and the implementation should work with Py2.7.