* Dave Angel <da...@ieee.org> [101016 03:45]:
>
> 1) The code is correct.  But it'd be much clearer if you followed  
> conventions and named your class with a leading uppercase.  So the  
> module would be called tmpl, and the class would be called Tmpl.
 <blush> I didn't know there was such a convention. Serves me right
 for being self-taught and self-employed </blush>
> 2) For the general case, this error is about fetching attributes from  
> arbitrary objects.  Such an object is not always bound to a single name,  
> so it reports the object's type, rather than its name.  In this  
> particular case, a module has a unique name, so the message could have  
> been more helpful.  But it's not clear how the error display logic could  
> have readily known that.
  Ah! Understood.

> Two things could help you figure it for yourself more quickly.  a) On  
> the left side of such an assignment, this error can only refer to  
> attributes other than the last, since the last one is being created  
> here, and it wouldn't matter if it already existed.  b) You could  
> refactor the line, and see where the error message moves to.  Let's try  
> that:
  Good trick.
>
> a = kbLib.templatepath
> tmpl.Ttmpl.templatepath = a
>
> If the line that now gets the error had still been confusing, you could  
> try to refactor that in turn.
  thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to