Message3680
The interval syntax has the drawback to require an upper value,
which is not true for specs like ">5".
I have implemented a module (attached) which supports:
- Daniel's simple conditions (">a", "<a")
- closed intervals ("[a,b]")
- ISO open intervals ("]a,b[")
- set builder open intervals ("(a,b)")
- boolean operators ("and" and "or", also accepted as "&&" and "||")
The expression is tokenized, and some operators are accepted in variants
known from other programming languages; then, some simple
transformations are performed to create a valid Python expression.
The comma is not accepted as a boolean operator because it is needed
for the interval notion.
I'm not sure whether it does really make sense to support open
intervals; however, it is possible (and done). Of course, this could be
removed easily.
I'll upload a test module as well; with Python 2.5+, it yields a strange
message:
Exception exceptions.RuntimeError: 'generator ignored GeneratorExit'
in <generator object at 0x00AC6E68> ignored
However, all implemented tests succeed. |
|
Date |
User |
Action |
Args |
2009-04-03 08:13:10 | tobias-herp | set | messageid: <1238746390.4.0.882791186673.issue1182919@psf.upfronthosting.co.za> |
2009-04-03 08:13:10 | tobias-herp | set | recipients:
+ tobias-herp, richard, schlatterbeck, ajaksu2 |
2009-04-03 08:13:10 | tobias-herp | link | issue1182919 messages |
2009-04-03 08:13:09 | tobias-herp | create | |
|