konstin on master
Add support for macOS universal… Merge pull request #403 from me… (compare)
konstin on master
Clippy lints (compare)
konstin on master
Use PYO3_CROSS_LIB_DIR as libs … (compare)
github-actions[bot] on gh-pages
Upload documentation for master (compare)
TypeError: Can't convert <FileType object at 0x7fe7fa782870> to PyString
, because I'm trying to assign a class to a field of type string. Can I implement e.g. Into<String> or Into<PyString> to make it work?
some_python_method(arg.copy())
. I've tried, from Rust, calling the PyObject .call_method0('copy')
function as well as Rust's .copy()
method before passing the PyObject argument to the Python function, but it still ends up mutating the original PyObject. Thought there's maybe something simple I'm missing.
copy
so I assume you meant clone
?)
.copy()
does exactly the same thing as it does in python (because it calls into python).
#[derive(FromPyObject)]
- if you're interested in helping finish off PyO3/pyo3#1045 I think we're not far from supporting C-style enums more fully. For the FileType
object assignment I'm a little confused exactly what you're asking. I think you might be looking for .to_string()
from std::string::ToString
trait? Just impl Display for FileType
? Or maybe if you're wanting PyString
to automatically convert to FileType
- that's an interesting one, not supported right now. Maybe could open an issue about it? Not sure if we'd want that, implicit conversions are not very Rusty...
FileType
are even better anyway!
#[pyfunction]
which takes PyArray2
argument and then calls the Rust function.
ndarray
forum
pub struct InnerStruct {
pub a: u32,
pub b: u16,
...
pub z: u64,
}
#[pyclass]
pub struct MyWrapperClass {
pub inner: InnerStruct,
}
datetime.timedelta
, I think it'd be appropriate?
PyResult<String>
writeln!()
to add newline characters. My problem is these are printed as escaped '\n' on the python side. I'd like them to be "decoded" I guess and actually print on the next line.
True
rather than true
macro_rules! python_repr {
($x:expr) => {
ToPyObject::to_object($x).__repr__()
}
}