persistent deque

Larry Bates larry.bates at websafe.com`
Tue May 20 19:53:35 EDT 2008


inhahe wrote:
>   def __init__(self, filename, initial):
> 
> should be
> 
>   def __init__(self, filename, initial=[]):
> 
> (that was the whole reason i put the filename first.)
> 
> sorry.
> 
> 
> 
Defaulting initial to empty list this way is asking for trouble.  You should
default it to None and check for None and reset to empty list.

-Larry



More information about the Python-list mailing list