Re: accessing an object instance by only having one of its attribute values

2007-07-10 Thread Bruno Desthuilliers
mshiltonj a écrit : > On Jul 8, 8:29 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: >> On Jul 8, 2:11 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > >> I have some comments on the Pythonicity of your suggestions. Same >> assumption, object attr is a unique key of some sort. How to create >> the dict of

Re: accessing an object instance by only having one of its attribute values

2007-07-09 Thread Paul McGuire
On Jul 8, 8:29 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > > Not sure why I slipped into the habit of testing for None, though. :-( > There is nothing wrong with testing for None. But the right ways to test for None are: if x is None: and if x is not None: Since None is a singleton, it is a w

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread mshiltonj
On Jul 8, 8:29 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 8, 2:11 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > I have some comments on the Pythonicity of your suggestions. Same > assumption, object attr is a unique key of some sort. How to create > the dict of objects, and how to retriev

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread Paul McGuire
On Jul 8, 2:11 pm, mshiltonj <[EMAIL PROTECTED]> wrote: > On Jul 8, 2:18 pm, [EMAIL PROTECTED] wrote: > > > Hello all, > > > Imaybe someone can help me with this question. > > Is there a direct way of accessing an object instance, if all I know > > is the value of one of its attributes? > > The obj

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread mshiltonj
On Jul 8, 2:18 pm, [EMAIL PROTECTED] wrote: > Hello all, > > Imaybe someone can help me with this question. > Is there a direct way of accessing an object instance, if all I know > is the value of one of its attributes? > The object is part of a list of objects, and I would like to pick the > objec

Re: accessing an object instance by only having one of its attribute values

2007-07-08 Thread Stargaming
[EMAIL PROTECTED] wrote: > Hello all, > > Imaybe someone can help me with this question. > Is there a direct way of accessing an object instance, if all I know > is the value of one of its attributes? > The object is part of a list of objects, and I would like to pick the > object directly by usin

accessing an object instance by only having one of its attribute values

2007-07-08 Thread feli . hp
Hello all, Imaybe someone can help me with this question. Is there a direct way of accessing an object instance, if all I know is the value of one of its attributes? The object is part of a list of objects, and I would like to pick the object directly by using this attribute value, instead of goin