persist-queue icon indicating copy to clipboard operation
persist-queue copied to clipboard

[Regression] Can no longer retrieve None without raw=True

Open NovaNekmit opened this issue 4 years ago • 1 comments
trafficstars

It used to work with a previous version, but doesn't work anymore.

None can still be put inside, but getting it out (without raw) will get stuck ie here.

Not sure what would be best, there are couple options:

  • Use an exception instead of "special return values" to signal no object
  • Use an unique object internally in place of None, ie NO_OBJECT = object()
  • Add raw=False to put and raise an warning when None inside unless it is set (to notify developers)
  • Leave as is and hope developers notice this API change and find out to use raw by themselves

NovaNekmit avatar Jun 30 '21 16:06 NovaNekmit

I personally prefer not adding the None into the queue since the None itself may cause other issue inside the queue implementation.

peter-wangxu avatar Sep 05 '21 15:09 peter-wangxu