When you file the doc bug, make sure that your "in this case" paragraph mentions __nonzero__ rather than __getitem__ (assuming you use the same example that started this, of course).
At 06:11 AM 5/24/2006, Sanghyeon Seo wrote >2006/5/24, Sanghyeon Seo <[EMAIL PROTECTED]>: >> Obscure. The issue is that special method lookup should only happen on >> the type, not the instance. I am not sure whether this is clearly >> specified... > >Python Reference Manual 3.3. The wording is not the best. Should file a doc >bug. > >"For instance, if a class defines a method named __getitem__(), and x >is an instance of this class, then x[i] is equivalent to >x.__getitem__(i)." > >In this case, although x.__getitem__ exists, x is an instance of a >class which *does not* define a method named __getitem__(), so it >should not be called. > >Seo Sanghyeon J. Merrill / Analytical Software Corp _______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
