jfhbrook / pyee

A rough port of Node.js's EventEmitter to Python with a few tricks of its own
https://github.com/jfhbrook/public
MIT License
362 stars 37 forks source link

Enable being dumped via pickle & similar #117

Closed LivInTheLookingGlass closed 1 year ago

jfhbrook commented 1 year ago

Looks like some test/lint failures, but in the meantime: what the heck is motivating this change??

LivInTheLookingGlass commented 1 year ago

I'm running a bot to manage prediction markets on manifold.markets, and it would be great if I can load them into my database. The use case is for things like leaving a comment on market resolution as to why it was resolved that way

I implemented a hacky version of this in my code, and just now realized I could adapt this upstream so that someone else might not have that problem

LivInTheLookingGlass commented 1 year ago

There probably are better ways to implement the larger goal, but making this serializable was surprisingly simple. I'd already had to muck around with that to ensure logger objects and credentials don't get captured

LivInTheLookingGlass commented 1 year ago

Just wanted to bump in case this was forgotten about. The tests do pass now