comment here
This commit is contained in:
8
.CondaPkg/env/lib/python3.11/site-packages/jsons/serializers/default_complex.py
vendored
Normal file
8
.CondaPkg/env/lib/python3.11/site-packages/jsons/serializers/default_complex.py
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
def default_complex_serializer(obj: complex, **_) -> dict:
|
||||
"""
|
||||
Serialize a complex as a dict.
|
||||
:param obj: the complex.
|
||||
:param _: not used.
|
||||
:return: a ``dict``.
|
||||
"""
|
||||
return {'real': obj.real, 'imag': obj.imag}
|
||||
Reference in New Issue
Block a user