use Initiailizer for PyStaticMethod by HyunP-dev · Pull Request #3742 · RustPython/RustPython
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
| 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); |
Or add
expectedFailureon 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
changed the title
Update staticmethod.rs
use Initiailizer for PyStaticMethod
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.
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