why function got dictionary
Diez B. Roggisch
deets at nospam.web.de
Thu Apr 17 11:05:53 EDT 2008
AlFire wrote:
> Diez B. Roggisch wrote:
>>>
>>> Q: why function got dictionary? What it is used for?
>>
>> because it is an object, and you can do e.g.
>>
>
> you mean an object in the following sense?
>
> >>> isinstance(g,object)
> True
Yes.
>
> where could I read more about that?
I don't know. But essentially _everything_ in python is an object. Some of
them lack a __dict__ - e.g. int and float and such - for optimization
reasons. But apart from that, you can treat everything as an object.
Diez
More information about the Python-list
mailing list