-
Notifications
You must be signed in to change notification settings - Fork 776
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
Class module name default #1820
Comments
I agree that Also, I was thinking that with the future module syntax proposed in #694 (comment) it should become easy for us to automatically set the correct module name for the pyclass. |
Yes I am aware of the |
I would really like to introduce it as part of 0.15, yes. I'd love to build it myself eventually, however if anyone's interested in picking it up it'd be a very welcome addition! The way I was thinking of introducing it was that we'd continue to accept the existing |
Is this possibly a good “first timer” contribution? I’d love to get involved in this project but am a relative beginner in Rust and don’t want to bite off more than I can chew. |
Sorry for my slightly slow reply - I see you have started looking into the CI test failures, which is really appreciated. This issue is not the easiest, because the new Alternatively I can try to mark some issues with a label which suggests what's good to start with? |
No worries! Thanks for the thoughtful response. I'm not afraid to dive in but must admit I don't have experience with proc macros (yet) so I'm probably not the most efficient person to implement this. If there are better places to start I'd love some direction if/when you can find some time to label them. In the meantime I will keep an eye on the issues and just keep trying to familiarize myself with the code a bit more. |
For anyone looking, I began drafting an implementation in #2367 but haven't had time to finish it off. I do hope to get it over the line before too much more time passes! |
Closing, will track this as part of #3900 |
Hi,
I'm deeply annoyed by the fact that if you declare a module using the
#[pyclass]
macro the module name of the class isbuiltins
.I looked in the code and I understand why it's a bit problematic.
At first I thought adding the module name to
PyTypeInfo::type_object_raw
then it could propagate to the class definition where it can use the module name.I assume that's a bad practice as it's not part of the creation really..
Another thought I had in mind is to create a trait for
get_module_name
with a default implementation, then have a macro for adding a class into a module where it impls the trait.Any feedback is welcome :)
The text was updated successfully, but these errors were encountered: