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

Comparison-test C and Python versions of various modules #2

Open
pganssle opened this issue Jan 30, 2020 · 2 comments
Open

Comparison-test C and Python versions of various modules #2

pganssle opened this issue Jan 30, 2020 · 2 comments

Comments

@pganssle
Copy link
Collaborator

The datetime module has an implementation both in C and in Python, and PEP 399 says that the tests must pass for both versions.

In CPython, some tricksy import magic is done to run the tests with and without the C extension. I don't really love it and I think it might actually be a bit fragile. We can always copy that solution, but I'm opening this ticket to brainstorm or just to put "we should consider other ways to accomplish this" on the to-do list.

@pschanely
Copy link

I cannot say how happy I am that you pointed this out to me. Datetime support is in the works!

@Zac-HD Zac-HD changed the title Test C and Python versions of the datetime module Comparison-test C and Python versions of various modules Apr 7, 2020
@Zac-HD
Copy link
Owner

Zac-HD commented Apr 7, 2020

@pganssle points out here that

If test.support.import_fresh_module were less touchy, I'd be all over this for datetime, and this whole class of tests is super useful for anything with both a C and Python implementation, for PEP 399 compliance. That includes, I believe, heapq, json and warnings, plus any new modules that have a C extension.

So fixing that and then writing the relevant tests seems like a useful thing to have on an issue tracker 😉

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

No branches or pull requests

3 participants