Using the Sendgrid Python lib (and sgbackend lib) which depends on this library (within Django), sending tasks to a background queue that first pickles the Mail being sent out, due to how Django attached the connection (backend) to each Mail object, it has an instance of the Client on it. It then pickles it to store it for the task queue and fails because pickle.dumps doesn't like the Client object, I think because getitem is overrode, so from what I can tell you just need to define setstate and getstate on Client's implementation.
Using the Sendgrid Python lib (and sgbackend lib) which depends on this library (within Django), sending tasks to a background queue that first pickles the Mail being sent out, due to how Django attached the connection (backend) to each Mail object, it has an instance of the Client on it. It then pickles it to store it for the task queue and fails because pickle.dumps doesn't like the Client object, I think because getitem is overrode, so from what I can tell you just need to define setstate and getstate on Client's implementation.