diff --git a/pubchempy.py b/pubchempy.py index 8de112f..7bfa4a3 100644 --- a/pubchempy.py +++ b/pubchempy.py @@ -560,7 +560,7 @@ def to_dict(self): for coord in {'x', 'y', 'z'}: if getattr(self, coord) is not None: data[coord] = getattr(self, coord) - if self.charge is not 0: + if self.charge != 0: data['charge'] = self.charge return data