On Mon, 17 Jul 2000, Chris McDonough wrote:

> How about a class attribute?
> 
> class MyClass:
> 
>     myAttr2 = 'Default'
> 
>     def getMyAttr1(self):
>         return self.myAttr1
> 
>     def getMyAttr2(self):
>         return self.myAttr2
> 
> If myAttr2 needs to be a ZClass instance, just grab it inside the class.

Again, it comes down to instantiation. I would need:

  class MyClass:

      myAttr2 = app.Control_Panel.Products.MyProduct.MyZClass('id')

and we're back to not having app, again.

Also, myAttr2 is volatile. Each instance of MyClass should have its own
instance of myAttr2; a class attribute would not give the desired
semantics.

I wish it were that easy.

Thanks,

--Jeff

---
Jeff K. Hoffman                               704.849.0731 x108
Chief Technology Officer                      mailto:[EMAIL PROTECTED]
Going Virtual, L.L.C.                         http://www.goingv.com/


_______________________________________________
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to