[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #6445 [Tor Relay]: Version spec revisions



#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs