Méta-MCI [EMAIL PROTECTED] wrote:
Example, with meta-data (attributs of function) :
def ff(this):
try:
this.count=this.count+1
except:
this.count=1
a=1
b=2
c=a+b
ff(ff)
fa=ff
ff(ff)
fa(fa)
print ff.count
How to improve that?
If I've
Re!
I can do :
def ff():
this=ff
try:
this.count=this.count+1
except:
this.count=1
a=1
b=2
c=a+b
ff()
fa=ff
ff()
fa()
print ff.count
But that use, inside the function, the litteral name of the function; and I
want no use litteral name (inside)
@+
Méta-MCI wrote:
Example, with meta-data (attributs of function) :
Apart from asking what counting nb call of a function means, I
wonder why you didn't use an iterator?
@-salutations
@-less Regards,
Björn
--
BOFH excuse #65:
system needs to be rebooted
--
Re!
why you didn't use an iterator?
If the iterator is extern (to the function), it's like decorator, or global
var.
If it is internal, it's huge, compare to this.count=this.count+1 (or
this.count+=1)
@+
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
Méta-MCI wrote:
If the iterator is extern (to the function), it's like decorator,
or global var.
Please excuse me, I don't understand your point. I'm not even sure
if both of us speak of the same iterators.
If it is internal, it's huge, compare to this.count=this.count+1
(or