Skip to content

Commit db6fd16

Browse files
authored
Merge pull request RustPython#3932 from jopemachine/edit-float-getformat
Fix `float.__getformat__`
2 parents 8f56c06 + 0e00ab6 commit db6fd16

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/builtins/float.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ impl PyFloat {
204204
}
205205
}
206206

207-
#[pymethod(magic)]
208-
fn getformat(&self, spec: PyStrRef, vm: &VirtualMachine) -> PyResult<String> {
207+
#[pystaticmethod(magic)]
208+
fn getformat(spec: PyStrRef, vm: &VirtualMachine) -> PyResult<String> {
209209
if !matches!(spec.as_str(), "double" | "float") {
210210
return Err(vm.new_value_error(
211211
"__getformat__() argument 1 must be 'double' or 'float'".to_owned(),

0 commit comments

Comments
 (0)