[Tutor] designing a class

Christopher Spears cspears2002 at yahoo.com
Fri Jan 27 17:39:16 CET 2006


> class MyList:
>    def __init__(self, aList=None):
>      if aList is None:
>        self._list = []
>      else:
>        self._list = aList[:]
> 

This code certainly looks like it will do the trick. 
I'm just not sure what the _ in front of list (i.e.
_list) denotes.



"I'm the last person to pretend that I'm a radio.  I'd rather go out and be a color television set."
-David Bowie

"Who dares wins"
-British military motto

"I generally know what I'm doing."
-Buster Keaton


More information about the Tutor mailing list