[Tutor] Some sample code: review?

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Sat Nov 11 05:30:49 CET 2006


> I should, though, rephrase the signature as:
>
>    register: object str_function -> string or None
>
> to be more readable.  Separately, I can then define that a 'str_function' is 
> a callable that takes anything and turns it into a string.

Ok, I made those changes.  I've also fixed a very silly bug.  (Basically, 
it's the same exact bug that the SOAPpy folks did in traversing shallow 
structures.)

Unfortunately, it got longer and more complicated than I wanted.  *sigh* 
Still, here it is:

     http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498261


More information about the Tutor mailing list