[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-3000
Subject:    Re: [Python-3000] Possible Duck Typing Problem in Python 2.5?
From:       Greg Ewing <greg.ewing () canterbury ! ac ! nz>
Date:       2007-12-09 23:46:51
Message-ID: 475C7E6B.4040906 () canterbury ! ac ! nz
[Download RAW message or body]

hashcollision wrote:

> TypeError: can only concatenate list (not "instance") to list
> 
> IMHO, this is a problem. Is it? If so, I suggest that it be fixed in python 3000.

I seem to remember this came up before, and was considered
not to be something that needed changing.

How would you decide what type the result should be?
Who's to say it should be a list and not an X?
Better to be explicit:

   l2 = l + list(x)

or if in-place modification is acceptable,

   l.extend(x)

--
Greg

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: http://mail.python.org/mailman/options/python-3000/python-3000%40progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic