On 18/10/2007, at 8:38 PM, David Binger wrote:

On Oct 18, 2007, at 6:12 AM, Peter Wilkinson wrote:

Hi,
I've started using Keep, Keyed, etc. which work quite nicely along with spec.

One issue that I've notices is that in .add(value) if you call that with a value which fails get_spec_problems(value) you can't call add again without clearing value.key, not a huge deal just a bit annoying.

Could there be an extra line added before the raise which just does "value.key = None"?

The problem with that is that the spec problems might have something to do with the key value itself.

Are you adding objects interactively or something? I can' t think of another
context where this would come up.

This is in testing, creating items with varying failures on attributes and stuffing them into a container. The behaviour just struck me as odd since the key is assigned by the container and out of control of the outside code so should the error reported be a different one? The only way I can see the key spec failing is if the counter has gone past sys.maxint which could be reported as some other error, KeysExhausted or something. Maybe Counter itself could do a self.set_next_available(self.next_available + 1) so that the failure happens earlier?

Not a major problem, just oddness when hitting it, and can certainly live with it as it is.

Peter W.




Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
QP mailing list
[email protected]
http://mail.mems-exchange.org/mailman/listinfo/qp

Reply via email to