-
Notifications
You must be signed in to change notification settings - Fork 804
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
Enable setting the module name of a class #477
Conversation
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 investigating the problem! |
This is relevant for pickling objects.
Codecov Report
@@ Coverage Diff @@
## master #477 +/- ##
==========================================
- Coverage 87.85% 87.85% -0.01%
==========================================
Files 65 65
Lines 3393 3416 +23
==========================================
+ Hits 2981 3001 +20
- Misses 412 415 +3
Continue to review full report at Codecov.
|
Some(module_name) => format!("{}.{}", module_name, T::NAME), | ||
None => T::NAME.to_string(), | ||
}; | ||
let name = CString::new(name).expect("Module name/type name must not contain NUL byte"); |
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.
*NULL ?
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.
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!
Building upon that, I think it would be cool to have something like #[pyclass(module = "foo.bar")]
Didn't implement setting it automatically to avoid unexpected behavior. Pickling is possible but very awkward.
#100
Closes #474