I'm in the process of translation some Rust code to Python. Suppose I have some API in Rust, and methods in Python to call the Rust methods under the hood.
Example Rust (pseudo) code:
struct Args {
foo: i32,
bar: f32,
}
pub fn DummyMethod(
&self,
args: Args
) -> Result<Data, Error>
Calling this method:
let args = InitTxArgs {
foo: i32,
..Default::default()
};
DummyMethod(args);
In Python I then have:
args = {
'foo' : 42
# How do I translate Default here?
}
DummyMethod(args)
How does one translate the ..Default in Rust to Python? I want to specify just the foo field, without specifying the other fields.