On Sun, 27 Mar 2005 17:06:05 -0800, Captain Dondo <[EMAIL PROTECTED]> wrote:
> [snip]
> 
>     def url (self):
>         self.url = ...
> 
>     def thumb (self):
>         self.thumb = ...
> 
> [snip]
> 
> The problem is that m.html in the test section fails with 
> 
> TypeError: cannot concatenate 'str' and 'instancemethod' objects
> 
> [snip]

    Notice that you have a method named "url" as well as an attribute named 
"url".  You have the same problem for "thumb".  These methods and attributes 
are in collision with each other.  When you try to look up the attribute, you 
might get the method.  When you try to look up the method, you might get the 
attribute.  It is deterministic, but depends on the order in which you do 
things, and highly confusing no matter what.  Avoid naming attributes and 
methods the same thing.

  Jp
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to