Skip to content

Commit

Permalink
Improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed May 26, 2023
1 parent cee4a2a commit 8e6b7dc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/conversions/num_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,11 @@ macro_rules! complex_conversion {

#[cfg(any(Py_LIMITED_API, PyPy))]
unsafe {
use crate::{intern, type_object::PyTypeInfo};

let obj = if PyComplex::is_type_of(obj) {
let obj = if obj.is_instance_of::<PyComplex>() {
obj
} else if let Ok(method) =
obj.get_type().getattr(intern!(obj.py(), "__complex__"))
} else if let Ok(method) = obj
.get_type()
.getattr(crate::intern!(obj.py(), "__complex__"))
{
method.call1((obj,))?
} else {
Expand Down

0 comments on commit 8e6b7dc

Please sign in to comment.