__setitem__ puzzle

Aahz aahz at pythoncraft.com
Mon Apr 21 09:28:54 EDT 2003


In article <b80q7c$cmd$1 at news.hccnet.nl>,
Anton Vredegoor <anton at vredegoor.doge.nl> wrote:
>
>I have subclassed the builtin list type to accept tuples for indexing.
>I am just experimenting with the code to see what I can do with it, so
>asking for what the code will be used for in order to provide a better
>way to do it will be answered with 'ni' :-)

"If you don't know what your program is supposed to do, you'd better not
start writing it."  --Dijkstra

>There's a problem with __setitem__ however. What's the proper way to
>write this class?

While I understand your point about expirimenting, I can't give you any
useful advice unless I know what your code is intended to do, and I doubt
many people on c.l.py will do much better.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Why is this newsgroup different from all other newsgroups?




More information about the Python-list mailing list