[Twisted-Python] Re: +AFs-Twisted-Python+AF0- Re: +AFs-Twisted-commits+AF0- CVS: Twisted/twisted/python otp.py,NONE,1.1

Benjamin Bruheim grolgh at online.no
Wed Sep 5 21:09:35 EDT 2001


+AD4- +AD4- def stringToLong(s):
+AD4- +AD4-     +ACIAIgAi- Convert bytes to long integer +ACIAIgAi-
+AD4- ...
+AD4- +AD4- def stringToDWords(s):
+AD4- +AD4-     +ACIAIgAi- Convert bytes to a list of four 32-bits words +ACIAIgAi-
+AD4- ...
+AD4- +AD4- def longToString(l):
+AD4- +AD4-     +ACIAIgAi- Convert long to digest +ACIAIgAi-
+AD4- ...
+AD4- 
+AD4- Was there a good reason you reimplemented the struct module in Python?

Well, struct seems almost like an overkill, but could probably replace most usage of these routines. If I should need a good reason for keeping them, it would be my uncertainity of its (structs) endianism/portability since the codes need to be. It just looks like a module only used in interfacing. 

This is an only excuse since I didn't know of struct. :) Thanks for the tip

// phed







More information about the Twisted-Python mailing list