TypeError when subclassing 'list'

Gerard Flanagan grflanagan at yahoo.co.uk
Mon Feb 27 06:37:21 EST 2006


Simon Percivall wrote:
> The error you're seeing is because you've rebound 'list' to something
> else. Try putting "list = type([])" somewhere above your code.

That's it!  I had rebound 'list' earlier (in error), and though I
deleted the code it must have been "remembered" somehow.  Restarting
PythonWin this morning, there was no error.  Now I've just spent twenty
minutes wondering why  'x.apppend(y)' was raising an
AttributeException! It's going to be one of those weeks...

Thanks Simon

Gerard




More information about the Python-list mailing list