-
Notifications
You must be signed in to change notification settings - Fork 1.3k
4982 - Implement tm_gmtoff and tm_zone #5391
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
4982 - Implement tm_gmtoff and tm_zone #5391
Conversation
I was about to say you don't have to Buf if you're a noob then I'll try to explain: In other words: if you have to name a type - say to call an associated method like use std::cell::OnceCell; ...somewhere in the file/function but if you're only calling a method that returns a |
Thanks for the feedback. I did so right before this comment 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing. You will want to run some tests about timezones. Here is a few commands not to wait the full CI run.
cargo run extra_tests/snippets/stdlib_datetime.py # most simple one
cargo run Lib/test/test_time.py # test `time` module
cargo run Lib/test/test_datetime.py # test `datetime` module
This doesn't look good... those tests all expect In other words the original comment from the issue is wrong - it won't be that easy to "just add" those fields (unfortunately) |
@youknowone if I'm right and there's no way to mark a There isn't, right? |
I think you're right. I came to conclusion much slower though through messing around with the failing tests. |
@JazzGlobal well... this is going to require major changes (completely restructuring the definition of So... are you up for it? |
yeah I'll fiddle with this for a while longer. |
@miviwi what are you doing? you don't close the PR. you can't do that. |
@youknowone hold on... not closing anything yet, or now that JazzGlobal has spoken not at all 😅 |
Community is a bit more moderated since I last contributed lol. I'll look at some of the other Traverse implementations for hints on how I should do it for PyStructTime. Thanks guys! |
@JazzGlobal Don't worry about it that much. We can solve things step by step, eventually. Nothing changed from the time you visited before. |
@JazzGlobal Personally I would first try just leaving |
I am not getting how PyTraverse is related to this problem yet. I'd like to fix pystructseq side first. @JazzGlobal Are you also interested in proc macro? Then the point will be the start point. Otherwise let me make some changes on PyStructSequence. I don't have a good idea how to change it right now though. |
@youknowone not as the code is right now, but making the struct a |
Maybe there is confusion. PyTraverse used only for GC. I hope I can solve it with PyStructSequence. |
If utilizing Traverse is not an option then go for it. |
@youknowone Should this be closed until that work in completed? |
I don't think any PR need to be closed due to blocking issues. We always encounter unexpected blocking issues for numerous patches. We can fix them and come back to the original issue whenever we can. We can review unresolved opened PRs later. But not about unresolved closed PRs. So unclosed PRs are more helpful than closed PRs. |
How about adding |
Do you mean EDIT: Or would |
Yes, adding a new attribute pytraverse is only used for GC, so not here. |
I'm not familiar with Rust macros. Will pystruct("skip") essentially be the same thing implementation-wise as pytraverse? |
97cbe51
to
853d667
Compare
Unfortunately, it now runs but still tm_gmtoff is not accessible. |
af3c077
to
d345ddc
Compare
d345ddc
to
763ba9f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JazzGlobal It look long time, but finally added required support. Thank you for contributing. I am sorry if you felt inconvenience. Please don't worry to be moderated not by CoC but by code. Whenever everybody every code will be welcomed.
No problem at all. I like contributing to the project and it isn't about me. Thanks for your help in facilitating this! |
Fixes #4982
Implements the missing
tm_gmtoff
andtm_zone
fields in PyStructTime struct.The original issue's code example does not work in python 3.12. I used this instead for testing: