madpython <[EMAIL PROTECTED]> wrote:
> Thanks, Alex, again. The lesson has been taught. I appreciate very much
> you spent time trying to help. Indeed the culprit of that infrequent
> infinite loops was that bound reference "item" in the printing
> loop. But frankly i thought that it only existed
Thanks, Alex, again. The lesson has been taught. I appreciate very much
you spent time trying to help. Indeed the culprit of that infrequent
infinite loops was that bound reference "item" in the printing
loop. But frankly i thought that it only existed inside that loop.
Apparently I was wrong and g
madpython <[EMAIL PROTECTED]> wrote:
> Thanks Alex and Scott for your lead. It would've taken me forever
> trying to figure it out by myself :)
>
> I am affraid I didn't specify initially one thing and that led to a
> confusion: there is no need to pick an instance from the weakref
> dictionary,
Thanks Alex and Scott for your lead. It would've taken me forever
trying to figure it out by myself :)
I am affraid I didn't specify initially one thing and that led to a
confusion: there is no need to pick an instance from the weakref
dictionary, just return None if there are already 5 instances.
madpython wrote:
> For the pure theory sake and mind expansion i got a question.
> Experimenting with __new__ i found out how to create a singleton.
> class SingleStr(object):
> def __new__(cls,*args,**kwargs):
> instance=cls.__dict__.get('instance')
> if instance:
>
madpython <[EMAIL PROTECTED]> wrote:
> For the pure theory sake and mind expansion i got a question.
> Experimenting with __new__ i found out how to create a singleton.
> class SingleStr(object):
> def __new__(cls,*args,**kwargs):
> instance=cls.__dict__.get('instance')
> if in
For the pure theory sake and mind expansion i got a question.
Experimenting with __new__ i found out how to create a singleton.
class SingleStr(object):
def __new__(cls,*args,**kwargs):
instance=cls.__dict__.get('instance')
if instance:
return instance
cls.in