[Distutils] Pep 440 question/clarification Version specifiers no "Or" available

Donald Stufft donald at stufft.io
Thu Sep 8 22:21:24 EDT 2016

> On Sep 8, 2016, at 6:47 PM, Matthias Bussonnier <bussonniermatthias at gmail.com> wrote:
> Is there no way to have an "or" ? It seem to me that it might be
> useful for package wanting to express compatibility with `2.6`, `2.7`
> or `>3.3` for example, in the form `=~2.6 <or operator> =~3.3`.
> I completely agree that the use case is _limited_ and likely rare, I
> was just wondering if I'm missing something, if it was an oversight
> and if not if adding a section detailing that "or" was not considered,
> or that "or" was explicitly not included for X,Y,Z reason would be a
> good thing.

There is currently no way to have an or. I don’t think there is any conceptual reason not to have it, except we were attempting to deviate from what was currently accepted as little as possible and the only character that was currently accepted was only ``,``. We did deviate in that the behavior of ``,`` changes somewhat, but the previous behavior was very tricky and hard to explain.

In the future I’d actually like to expand upon it but I think that once you add OR you kind of also need to add a grouping operator as well to handle more complex cases besides ones where you only need AND or OR. I think this would probably be a good place to just add a new AND syntax too, and make it something like:

`(~=2.6 or ~=3.3) and != 2.6.5`

That was more of a shake up then we wanted to do at the time though.

Donald Stufft

More information about the Distutils-SIG mailing list