Hi all,
Excuse for TOFU. Thanks a lot Steven, Dave and Hugo.
Steven the explanation was really great. Thanks a lot for it.
Hugo, I was just curious, have no real need. Thanks.
With warm regards,
-Payal
--
On Tue, Jun 08, 2010 at 08:07:28PM +1000, Steven D'Aprano wrote:
> On Tue, 8 Jun 2010 04:
On 8 jun 2010, at 08:08, Payal wrote:
> Hi,
> If I have a list (or a dict), is there any way of knowing how many
> other
> variables are referencing the same object?
>
In short, not in any compatible way. If you have a bounded list of
names, you can check them with the is operator. But the quest
Payal wrote:
Hi,
If I have a list (or a dict), is there any way of knowing how many other
variables are referencing the same object?
With warm regards,
-Payal
Depends on what you mean by variables.
Try sys.getrefcount(mylist)
Naturally, the count will be one higher than you expect. And
On Tue, 8 Jun 2010 04:08:15 pm Payal wrote:
> Hi,
> If I have a list (or a dict), is there any way of knowing how many
> other variables are referencing the same object?
Sort of. The question is simple, but the answer isn't. It depends what
you mean by "variables", and it requires a good understa
Hi,
If I have a list (or a dict), is there any way of knowing how many other
variables are referencing the same object?
With warm regards,
-Payal
--
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.py