[tor-bugs] #6445 [Tor Relay]: Version spec revisions
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Mon Jul 23 16:36:28 UTC 2012
#6445: Version spec revisions
-------------------------+--------------------------------------------------
Reporter: atagar | Owner:
Type: enhancement | Status: needs_review
Priority: minor | Milestone:
Component: Tor Relay | Version:
Keywords: | Parent:
Points: | Actualpoints:
-------------------------+--------------------------------------------------
Comment(by atagar):
> If you find a pair of elements that are not equal, then the sequence
containing the earlier element is lexically earlier.
Ahh, gotcha. Maybe I'm misunderstanding what "inverse ordinal" order means
since I thought that's what this is. Ie...
{{{
>>> def is_greater_than(a, b):
... for i in xrange(len(a)):
... if i > len(a):
... return True
... elif ord(a[i]) < ord(b[i]):
... return False
... elif ord(a[i]) > ord(b[i]):
... return True
... return False
>>> is_greater_than("rc", "alpha")
True
>>> is_greater_than("alpha", "beta")
False
>>> is_greater_than("ho hum", "Ho hum")
True
}}}
(code just scratched together, didn't give much thought to the empty
comparisons)
Thanks for the clarification. :)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6445#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list