[EMAIL PROTECTED] wrote:
> Yes that's better. Didn't know about the __class__ attribute. I
> thought there must be a way to access this but couldn't find it in the
> docs.
>
> Thanks,
>
> Andy
>
dir(), help() and the interactive interpreter (IDLE or CLI) are your
best friends.
Any time you w
Yes that's better. Didn't know about the __class__ attribute. I
thought there must be a way to access this but couldn't find it in the
docs.
Thanks,
Andy
--
http://mail.python.org/mailman/listinfo/python-list
On 2 Feb 2006 12:08:43 -0800, [EMAIL PROTECTED] wrote:
>Hi,
>
>I'm trying to write a method that needs to know both the class name and
>the instance details
>
>class A:
>
>@classmethod
>def meth(cls, self):
>print cls
>print self
>
>a = A()
>a.meth(a)
>
>The above code seem
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm trying to write a method that needs to know both the class name and
> the instance details
>
> Any suggestions?
>
What's the point of using a classmethod and an explicit cls argument
when you can get the class object from the instance itself?
>>> class