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

[tor-commits] [stem/master] Replacing reversed() in tutorial



commit 11edc074fcd9f5d178899d3f4d8b6545bcd5d429
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Oct 14 11:30:01 2012 -0700

    Replacing reversed() in tutorial
    
    Dropping the reversed() call in the tutorial in favor of providing the
    'reverse = True' argument to sorted(). Thanks to gsathya for the suggestion.
---
 docs/index.rst                             |    4 ++--
 test/integ/descriptor/server_descriptor.py |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/docs/index.rst b/docs/index.rst
index 05c5296..d6d7f01 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -58,7 +58,7 @@ You'll need to restart Tor or issue a SIGHUP for these new settings to take effe
   % python example.py 
   My Tor relay has read 33406 bytes and written 29649.
 
-Congratulations! You've written your first controller script.
+Congratulations! You've just written your first controller script.
 
 Mirror Mirror on the Wall
 -------------------------
@@ -89,7 +89,7 @@ To read this file we'll use the :class:`~stem.descriptor.reader.DescriptorReader
       if desc.exit_policy.is_exiting_allowed():
         bw_to_relay.setdefault(desc.observed_bandwidth, []).append(desc.nickname)
   
-  sorted_bw = reversed(sorted(bw_to_relay.keys()))
+  sorted_bw = sorted(bw_to_relay.keys(), reverse = True)
   
   # prints the top fifteen relays
   
diff --git a/test/integ/descriptor/server_descriptor.py b/test/integ/descriptor/server_descriptor.py
index 21d0b33..0790131 100644
--- a/test/integ/descriptor/server_descriptor.py
+++ b/test/integ/descriptor/server_descriptor.py
@@ -32,7 +32,7 @@ class TestServerDescriptor(unittest.TestCase):
         if desc.exit_policy.is_exiting_allowed():
           bw_to_relay.setdefault(desc.observed_bandwidth, []).append(desc.nickname)
     
-    sorted_bw = reversed(sorted(bw_to_relay.keys()))
+    sorted_bw = sorted(bw_to_relay.keys(), reverse = True)
     
     # prints the top fifteen relays
     



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits