depending on what you've done / referenced before you get the copy, your
list will differ...

The underscores (single, double, triple) do appear to be transient; the
others are internal references.

No matter what, that ****[0]  just won't work.   I've already tried this on
a couple of different machines, and I _can_ get to where 'foobar' is item[0]
in the list - sometimes, and not reliably.  More often, it's _sometimes_
item[0];   an activity (like a reference) disrupts that list.

Anyway, this is interesting - good luck.  I think you'll have to get the
list, and manually remove the '_names' (including '__);

Look at my first "test results" post of this thread - '_5' was at the head
of that list (due to what activity happened, and how references were
generated) ---- it stayed at the head of the list;   '_5' does not seem like
intermediate results, rather internally generated reference(s).  Those
references seem to "stay around" ... don't know for what length of time, but
certainly the duration of my tests (gc might clean them up).

Another time,  '__' was at the head, but (as you noticed) that's transient,
and went away.

I think you have _incidentally_ hit on cases where item[0] just happens to
be what you want.  It doesn't look to me like you can count on that.

Regards,
Yarko

On Wed, Dec 17, 2008 at 4:30 PM, DenesL <[email protected]> wrote:

>
> Yarko,
>
> I think those underscored keys come from intermediate results.
> Not sure about those double and triple ones.
> An improved version (of either J's or M's) would have to work with a
> copy of globals:
>
> import copy
> def getName(obj):
>    g=copy.copy(globals())
>    return([k for k,v in g.items() if v is obj]+[None])[0]
>
> I don't get any underscores this way, how about you?.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to