[Python-Dev] [Python-checkins] peps: PEP 426: replace implied 'version starts with' with new ~= operator
Nick Coghlan
ncoghlan at gmail.com
Sat Feb 23 16:23:24 CET 2013
On Sun, Feb 24, 2013 at 12:57 AM, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> Nick Coghlan <ncoghlan <at> gmail.com> writes:
>
>> Daniel is a fan of this syntax, but I think it is inferior to the
>> implied approach, so don't expect it to survive to any accepted
>> version of the PEP :)
>
> Another thing against ~= is that it isn't valid Python syntax. It's not a deal-
> breaker, but it does mean that you can't e.g. use the ast module in the
> implementation. This might be a factor if the mini-language ever grows (as it
> recently did, adding parentheses).
Daniel persuaded me that the *semantics* of Ruby's ~> pessimistic
version comparison operator are highly desirable. I liked them so
much, I'm now proposing them as the default behaviour of version
specifiers. Thus, the "~=" operator goes away, and you can use "==" to
explicitly request the previously proposed default behaviour, or just
append an extra ".0" if you're more pessimistic about a dependency's
backwards compatibility policies than the default interpretation.
This and other aspects will be brought up on distutils-sig at some
point not too far in the future :)
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Dev
mailing list