Message171167
| Author |
nparikh |
| Recipients |
christian.heimes, docs@python, ezio.melotti, mark.dickinson, nparikh |
| Date |
2012年09月24日.18:18:18 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1348510699.55.0.00341422831466.issue16011@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Thanks for passing along the thread, it was interesting. Oddly, it seemed to die off with no real resolution.
I realize it is now too late to change __contains__ to return a non-boolean value, but for reference, the reason I wanted to return something different from __contains__ was also to implement a DSL, though not a SQL-related one. Basically, I have some kind of abstract mathematical set S, and I wanted "x in S" to return a constraint that the variable x must lie in the set S for use in a larger problem description. (In fact, one could implement __contains__ so it returned True/False with a constant numeric argument and a constraint object with a variable argument.) This would have mirrored the way one would write all this mathematically. |
|