File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,9 @@ fn float_pow(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
268268
269269pub fn init ( context : & PyContext ) {
270270 let float_type = & context. float_type ;
271+
272+ let float_doc = "Convert a string or number to a floating point number, if possible." ;
273+
271274 context. set_attr ( & float_type, "__eq__" , context. new_rustfunc ( float_eq) ) ;
272275 context. set_attr ( & float_type, "__lt__" , context. new_rustfunc ( float_lt) ) ;
273276 context. set_attr ( & float_type, "__le__" , context. new_rustfunc ( float_le) ) ;
@@ -291,4 +294,9 @@ pub fn init(context: &PyContext) {
291294 context. set_attr ( & float_type, "__pow__" , context. new_rustfunc ( float_pow) ) ;
292295 context. set_attr ( & float_type, "__sub__" , context. new_rustfunc ( float_sub) ) ;
293296 context. set_attr ( & float_type, "__repr__" , context. new_rustfunc ( float_repr) ) ;
297+ context. set_attr (
298+ & float_type,
299+ "__doc__" ,
300+ context. new_str ( float_doc. to_string ( ) ) ,
301+ ) ;
294302}
You can’t perform that action at this time.
0 commit comments