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 675a214 commit 8e5b5ffCopy full SHA for 8e5b5ff
src/input/input_python.rs
@@ -292,15 +292,12 @@ impl<'py> Input<'py> for Bound<'py, PyAny> {
292
}
293
294
if self.is_instance_of::<PyComplex>() {
295
- if !strict {
296
- if let Ok(real) = self.getattr(intern!(self.py(), "real")) {
297
- if let Ok(float) = real.extract::<f64>() {
298
- return Ok(ValidationMatch::lax(EitherFloat::F64(float)));
299
- }
300
301
- } else {
+ if strict {
302
return Err(ValError::new(ErrorTypeDefaults::FloatType, self));
303
+ let real = self.getattr(intern!(self.py(), "real")).unwrap();
+ let float = real.extract::<f64>().unwrap();
+ return Ok(ValidationMatch::lax(EitherFloat::F64(float)));
304
305
306
if !strict {
0 commit comments