changeset 598:79411fe0da54

Renamed variables to avoid clash with builtin type function.
author Martin Geisler <mg@daimi.au.dk>
date Sat, 22 Mar 2008 15:57:14 +0100
parents 5845aca82a6e
children 46bd23052806
files viff/runtime.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/viff/runtime.py	Sat Mar 22 15:56:05 2008 +0100
+++ b/viff/runtime.py	Sat Mar 22 15:57:14 2008 +0100
@@ -256,8 +256,8 @@
 
             self.factory.identify_peer(self)
         else:
-            program_counter, type, data = marshal.loads(string)
-            key = (program_counter, type)
+            program_counter, data_type, data = marshal.loads(string)
+            key = (program_counter, data_type)
 
             try:
                 deferred = self.incoming_data.pop(key)
@@ -268,8 +268,8 @@
             # TODO: marshal.loads can raise EOFError, ValueError, and
             # TypeError. They should be handled somehow.
 
-    def sendData(self, program_counter, type, data):
-        send_data = (program_counter, type, data)
+    def sendData(self, program_counter, data_type, data):
+        send_data = (program_counter, data_type, data)
         self.sendString(marshal.dumps(send_data))
 
     def sendShare(self, program_counter, share):
@@ -537,12 +537,12 @@
         result.addCallback(lambda _: None)
         return result
 
-    def _expect_data(self, peer_id, type, deferred):
+    def _expect_data(self, peer_id, data_type, deferred):
         assert peer_id != self.id, "Do not expect data from yourself!"
         # Convert self.program_counter to a hashable value in order to
         # use it as a key in self.protocols[peer_id].incoming_data.
         pc = tuple(self.program_counter)
-        key = (pc, type)
+        key = (pc, data_type)
 
         data = self.protocols[peer_id].incoming_data.pop(key, None)
         if data is None:
@@ -922,12 +922,12 @@
         self._bracha_sent_ready[pc] = {}
         self._bracha_delivered[pc] = {}
 
-        def unsafe_broadcast(type, message):
+        def unsafe_broadcast(data_type, message):
             # Performs a regular broadcast without any guarantees. In
             # other words, it sends the message to each player except
             # for this one.
             for protocol in self.protocols.itervalues():
-                protocol.sendData(pc, type, message)
+                protocol.sendData(pc, data_type, message)
 
         def echo_received(message, peer_id):
             # This is called when we receive an echo message. It