Extending Python by Adding Keywords & Data types

Paul McGuire ptmcg at austin.rr.com
Wed Aug 1 23:43:12 EDT 2007


On Aug 1, 8:08 am, Paul McGuire <pt... at austin.rr.com> wrote:
>
>     def add(self,other):
>         if len(self.contents) < self.capacity:
>             self.contents.append( other )
>         else:
>             raise ValueError("can't add any more to this Box")
>

I guess that really should raise an OverflowError...

-- Paul




More information about the Python-list mailing list