◐ Shell
clean mode source ↗

use Initiailizer for PyStaticMethod by HyunP-dev · Pull Request #3742 · RustPython/RustPython

youknowone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running cargo fmt --all will fix the fmt failure

youknowone

fn init(zelf: PyRef<Self>, args: Self::Args, vm: &VirtualMachine) -> PyResult<()> {
zelf.as_object()
.set_attr("__doc__", args.get_attr("__doc__", vm)?, vm)?;
// zelf.as_object().set_attr("__format__", args.get_attr("__format__", vm)?, vm);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// zelf.as_object().set_attr("__format__", args.get_attr("__format__", vm)?, vm);

@Snowapril

@fanninpm

Or add expectedFailure on that test and add separate PR for updating it.

Now that #3747 has been merged, can this be rebased on a fresh copy of the main branch?

@youknowone youknowone changed the title Update staticmethod.rs use Initiailizer for PyStaticMethod

Aug 7, 2022

youknowone

Comment on lines +80 to +81

zelf.as_object()
.set_attr("__doc__", args.get_attr("__doc__", vm)?, vm)?;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a fix. func object need to be replaced, not doc.

youknowone

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no behavior changed but harmless and preparation for next step