We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08e7ec9 commit 0bd1a3eCopy full SHA for 0bd1a3e
vm/src/vm/vm_object.rs
@@ -156,6 +156,15 @@ impl VirtualMachine {
156
.invoke(args, self)
157
}
158
159
+ /// Same as __builtins__.print in Python.
160
+ /// A convenience function to provide a simple way to print objects for debug purpose.
161
+ // NOTE: Keep the interface simple.
162
+ pub fn print(&self, args: impl IntoFuncArgs) -> PyResult<()> {
163
+ let ret = self.builtins.get_attr("print", self)?.call(args, self)?;
164
+ debug_assert!(self.is_none(&ret));
165
+ Ok(())
166
+ }
167
+
168
#[deprecated(note = "in favor of `obj.call(args, vm)`")]
169
pub fn invoke(&self, obj: &impl AsObject, args: impl IntoFuncArgs) -> PyResult {
170
obj.as_object().call(args, self)
0 commit comments