extend Version class so that 1.develop > 1.1#1979
extend Version class so that 1.develop > 1.1#1979davydden wants to merge 1 commit intospack:developfrom
Conversation
|
@citibeth @alalazo @adamjstewart : here is my quick solution ( |
|
This issue has clearly sparked passions. However, we are not ready for a PR because:
For that reason, I'm changing the status of this PR to WIP. |
|
This PR also does not involve the concretization algorithm, so I'm removing that label. |
|
i am not saying we are ready, this is a PR to show how easy is it to add what i suggested. But I agree that it should have |
|
@adamjstewart added the tiers you suggested. |
|
@davydden I still don't see any need for tier1 = ('develop', 'dev', 'latest')
tier2 = ('master', 'head', 'trunk')
def __gt__(self, other):
if self in tier1:
if other in tier1:
return False
else:
return True
elif self in tier2:
if other in tier1 or other in tier2:
return False
else:
return True
elif is_numeric(self):
if other in tier1 or other in tier2:
return False
elif is_numeric(other):
return numeric_comparison(self, other)
else:
return True
else:
return FalseI think your code does the same thing, but tries to do it by converting everything to a number for comparison. I agree that this is fewer lines of code, but is more of an abstraction. I think the point of this Issue is that we shouldn't have as many abstractions. My pseudo-code is a bit more direct, but I agree that it is more lines, and we would have to repeat something similar in other It's possible that you could convince me that your solution is superior to mine. But can you replace I noticed your recent edit. There's no reason that |
exactly.
i will try adopting your approach soon... I agree that it's more clean. |
|
@davydden Maybe make a second PR implementing my approach? I can see reasons why your current PR may be better in some respects and I want others to compare them. |
|
will do. |
|
@adamjstewart @alalazo: I don't have a strong opinion anymore on how many infinity-like strings we need in Version, so I will let @tgamblin or others with merge rights to decide. There are pro's and con's in both cases. I can fit the PR to either decision. |
|
since @tgamblin said
i will revert part of this PR to keep |
661e3e0 to
69d85a6
Compare
|
closing this one in favor of #1983, which I believe is a more elegant and robust solution. |
proposed solution to some issues discussed in #1975