Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106431 > unrolled thread
| Started by | Nagy László Zsolt <gandalf@shopzeus.com> |
|---|---|
| First post | 2016-04-04 12:55 +0200 |
| Last post | 2016-04-04 12:55 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: ANN: intervalset Was: Set type for datetime intervals Nagy László Zsolt <gandalf@shopzeus.com> - 2016-04-04 12:55 +0200
| From | Nagy László Zsolt <gandalf@shopzeus.com> |
|---|---|
| Date | 2016-04-04 12:55 +0200 |
| Subject | Re: ANN: intervalset Was: Set type for datetime intervals |
| Message-ID | <mailman.9.1459767357.32530.python-list@python.org> |
> Why do you limit the intervals to datetime? Are there any assumptions in > your code that would make it fail with int values? Just one. The empty interval is a singleton and I want it to be smaller than any other interval. UTC_ZERO = datetime.datetime.utcfromtimestamp(0) EMPTY_INTERVAL = Interval(UTC_ZERO, UTC_ZERO) # TODO: how generalize this for any ordered type? Probably I could use Interval(None, None), and refactor my code. The other problem would be __str__ and formatting, but that is easy to generalize. > > Personally I would use & | instead of * + -- Python is not Pascal ;) Operators changed to what you have suggested. (Also added ^ and __contains__) Thank you!
Back to top | Article view | comp.lang.python
csiph-web