En Thu, 17 Apr 2008 11:06:08 -0300, AlFire [EMAIL PROTECTED] escribió:
Q: why function got dictionary? What it is used for?
If you want more details, see PEP 232 that introduced function writable
attributes in Python 2.1: http://www.python.org/dev/peps/pep-0232/
--
Gabriel Genellina
[EMAIL PROTECTED] schrieb:
A: everything (or almost) in Python is an object. Including functions,
classes, modules etc.
Everything you can access from or through Python code must be an object.
Every object has at least a type and a reference count.
Christian
--
On Apr 17, 4:06 pm, AlFire [EMAIL PROTECTED] wrote:
Q: why function got dictionary? What it is used for?
As previously mentioned, a function has a __dict__ like (most) other
objects.
You can e.g. use it to create static variables:
int foobar()
{
static int i = 0;
return i
On 19 avr, 19:39, sturlamolden [EMAIL PROTECTED] wrote:
On Apr 17, 4:06 pm, AlFire [EMAIL PROTECTED] wrote:
Q: why function got dictionary? What it is used for?
As previously mentioned, a function has a __dict__ like (most) other
objects.
You can e.g. use it to create static variables
On Apr 19, 8:33 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
barfoo = foobar
foobar = lambda x : x
And boom.
That's why I used the qualifier 'roughly equivalent' and not simply
'equivalent'.
--
http://mail.python.org/mailman/listinfo/python-list
AlFire [EMAIL PROTECTED] 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
where could I read more about that?
This is a very useful
Hi,
I am seeking an explanation for following:
Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
def g(): return
...
g.__dict__
{}
Q: why function got dictionary? What it is used
AlFire wrote:
Hi,
I am seeking an explanation for following:
Python 2.5.2 (r252:60911, Apr 8 2008, 21:49:41)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more information.
def g(): return
...
g.__dict__
{}
Q: why function got
.__dict__
{}
Q: why function got dictionary? What it is used for?
A: everything (or almost) in Python is an object. Including functions,
classes, modules etc.
--
http://mail.python.org/mailman/listinfo/python-list
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
where could I read more about that?
Andy
--
http://mail.python.org/mailman/listinfo/python
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
11 matches
Mail list logo