On Tue, Apr 5, 2016, 10:46 PM Nagy László Zsolt <gand...@shopzeus.com> wrote:
> > >> How about creating two classes for this? One that supports zero sized > >> intervals, and another that doesn't? > > If you don't want zero sized intervals, just don't put any in it. You > > don't have a separate list type to support even integers vs one that > > supports all floats. What operations are made different in > > implementation by this restriction? > When you substract two sets, zero sized intervals may appear in the > result. It is not just a question of "putting or not putting them in". > Are zero sized intervals valid or not? In my particular application, > they are not. I think Michael was right: this cannot be generalized. It > is application dependent. > To emphasize that in your project, I'd keep the interval code in the same module you have the time calculations, rather than breaking it into a more generic sounding module. Once you relax your goals, you might not even need a class, just one or a few functions. > -- https://mail.python.org/mailman/listinfo/python-list