Re: TypeError: can't pickle HASH objects?

2008-10-01 Thread mdsherry
On Oct 1, 3:50 pm, est <[EMAIL PROTECTED]> wrote: > >>> import md5 > >>> a=md5.md5() > >>> import pickle > >>> pickle.dumps(a) > > Traceback (most recent call last): >   File "", line 1, in >   File "C:\Python25\lib\pickle.py", line 1366, in dumps >     Pickler(file, protocol).dump(obj) >   File "

Re: Making small executive file for distribution

2008-09-24 Thread mdsherry
On Sep 24, 9:17 am, Marin Brkic <[EMAIL PROTECTED]> wrote: > Not commercial distribution, but an academic kind of sorts - giving > the exe file to coleagues, so they can use it in their work. Giving > .py file is not an option, since due to centralized computer > maintenance, they don't (and cannot

Re: bad recursion, still works

2008-07-17 Thread mdsherry
On Jul 17, 8:27 am, Jeff <[EMAIL PROTECTED]> wrote: > Thanks, that made things very clear.  I like that technique for adding > memoization via the parameter.  That is clever.  It would be nice if > there were a way to have multiple functions close over a shared local > variable in Python, like let-

Re: bad recursion, still works

2008-07-15 Thread mdsherry
On Jul 15, 4:12 pm, iu2 <[EMAIL PROTECTED]> wrote: > On Jul 15, 9:30 pm, [EMAIL PROTECTED] wrote: > > > > > On Jul 15, 2:59 pm, iu2 <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I wrote this wrong recursive function that flattens a list: > > > > def flatten(lst, acc=[]): > > >     #print 'acc =',

Re: bad recursion, still works

2008-07-15 Thread mdsherry
On Jul 15, 2:59 pm, iu2 <[EMAIL PROTECTED]> wrote: > Hi, > > I wrote this wrong recursive function that flattens a list: > > def flatten(lst, acc=[]): >     #print 'acc =', acc, 'lst =', lst >     if type(lst) != list: >         acc.append(lst) >     else: >         for item in lst: >             f