agronholm / cbor2

Python CBOR (de)serializer with extensive tag support
MIT License
228 stars 59 forks source link

Complex numbers! #248

Open chillenb opened 2 weeks ago

chillenb commented 2 weeks ago

Things to check first

Feature description

It would be nice to have encoding and decoding of Python complex type, as well as complex arrays. These correspond to tags 43000 and 43001!

Use case

Complex numbers are the only unsupported Python builtin numeric type. If you support them, I'd have a good reason to use CBOR rather than JSON!

chillenb commented 1 week ago

I have added support for complex numbers here: https://github.com/chillenb/cbor2/tree/complex will make a PR soon after I write tests.