> The descriptor protocol is the mechanism that allows both property and
> method:
> http://docs.python.org/reference/datamodel.html#implementing-descriptors
> http://users.rcn.com/python/download/Descriptor.htm
>
> In your case, something like the following could do:

This looks awesome. I had no idea before, that such thing is possible.
Cool to know a new thing :-)

>>>> isinstance(Foo, type)
> False
>>>>
>
> But anyway...

Yeah, for old style classes it's not true, but for the new style it is:

In [18]: class Foo(object): pass
   ....:

In [19]: isinstance(Foo, type)
Out[19]: True

-- 
Filip Gruszczyński

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to