[Python-ideas] Adding`Unpicklable` to the `collections` module

Ram Rachum cool-rr at cool-rr.com
Tue Nov 30 14:14:35 CET 2010

Ram Rachum <cool-rr at ...| writes:
| | I agree with putting whatever in the pickle module.
| | 
| | If there were ever demand for json.Incompatible or whatever, there we 
| | have it.
| | 
| I think that naming it `pickle.Incompatible` would be the best indeed. The 
| reason I wanted to avoid having a positive `Pickleable` class is that people 
| might think that if something is an instance of it then it's pickleable, which 
| is false, since a list is "inherently pickleable" but a list containing a lock 
| object is not pickleable.
| So I think it will be best to have both a `pickle.Incompatible` and a 
| `pickle.Compatible`. The reason to have the negative is to let people inherit 
| from it, the reason to have the positive is to make `isinstance` calls more 
| natural. (i.e. avoid a double negative.)
| What do you think?
| Ram.

So... are people in favor of this idea?


More information about the Python-ideas mailing list