someone wrote:
On Jun 18, 12:49 pm, James Mills wrote:
On Fri, Jun 18, 2010 at 8:31 PM, someone wrote:
I was looking for a "short way" to do it because I have a lot
"some_object.attr.attr or some_object.other_attr.attr" in code. it
looks like I cannot replace attr with just other vari
On Jun 18, 2:37 pm, Bruno Desthuilliers wrote:
> someone a crit :
>
> > On Jun 18, 2:05 pm, Bruno Desthuilliers > 42.desthuilli...@websiteburo.invalid> wrote:
> (snip)
>
> >> Still has a "code smell" thing to me, but hard to say not knowing the
> >> real code and context.
>
> > sorry, code is not
someone a écrit :
On Jun 18, 2:05 pm, Bruno Desthuilliers wrote:
(snip)
Still has a "code smell" thing to me, but hard to say not knowing the
real code and context.
sorry, code is not about printing variables rather accessing, it's
just example.
Yeps, this I understood - hence the "but..
On Jun 18, 2:05 pm, Bruno Desthuilliers wrote:
> someone a crit :
>
>
>
>
>
> > On Jun 18, 12:49 pm, James Mills wrote:
> >> On Fri, Jun 18, 2010 at 8:31 PM, someone wrote:
> >>> I was looking for a "short way" to do it because I have a lot
> >>> "some_object.attr.attr or some_object.other_attr.
someone a écrit :
On Jun 18, 12:49 pm, James Mills wrote:
On Fri, Jun 18, 2010 at 8:31 PM, someone wrote:
I was looking for a "short way" to do it because I have a lot
"some_object.attr.attr or some_object.other_attr.attr" in code. it
looks like I cannot replace attr with just other variable
On Jun 18, 12:49 pm, James Mills wrote:
> On Fri, Jun 18, 2010 at 8:31 PM, someone wrote:
> > I was looking for a "short way" to do it because I have a lot
> > "some_object.attr.attr or some_object.other_attr.attr" in code. it
> > looks like I cannot replace attr with just other variable and must
On Fri, Jun 18, 2010 at 8:31 PM, someone wrote:
> I was looking for a "short way" to do it because I have a lot
> "some_object.attr.attr or some_object.other_attr.attr" in code. it
> looks like I cannot replace attr with just other variable and must
> type some_object.other_attr.attr or your solut
On 06/18/10 20:31, someone wrote:
> On Jun 18, 12:01 pm, "Gabriel Genellina"
> wrote:
>> En Fri, 18 Jun 2010 06:48:34 -0300, someone
>> escribió:
>>
>>> is it possible to make first attr variable?
>>
>>> some_object.attr.attr
>>
>>> so instead of attr I could use self.foo which has value "attr"
On Jun 18, 12:01 pm, "Gabriel Genellina"
wrote:
> En Fri, 18 Jun 2010 06:48:34 -0300, someone
> escribió:
>
> > is it possible to make first attr variable?
>
> > some_object.attr.attr
>
> > so instead of attr I could use self.foo which has value "attr"
>
> I think you're looking for
> getattr:
En Fri, 18 Jun 2010 06:48:34 -0300, someone
escribió:
is it possible to make first attr variable?
some_object.attr.attr
so instead of attr I could use self.foo which has value "attr"
I think you're looking for getattr:
http://docs.python.org/library/functions.html#getattr
name = "spam"
g
10 matches
Mail list logo