animalMutha wrote:
>> Consider reading the *second* paragraph about __setattr__ in section
>> 3.4.2 of the Python Reference Manual.
>
> if you are simply going to answer rtfm - might as well kept it to
> yourself.
For what it's worth, I (the original poster) am glad he answered that way.
It sho
[EMAIL PROTECTED] (Aahz) writes:
> In article <[EMAIL PROTECTED]>,
> Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>>Joshua Kugler <[EMAIL PROTECTED]> writes:
>>>
>>> self.me = []
>>> for v in obj:
>>> self.me.append(ObjectProxy(v))
>>
>>Note that is could be
On Sat, 26 Apr 2008 08:28:38 -0700, animalMutha wrote:
>> Consider reading the *second* paragraph about __setattr__ in section
>> 3.4.2 of the Python Reference Manual.
>
> if you are simply going to answer rtfm - might as well kept it to
> yourself.
Yes, but if you are telling where exactly to f
In article <[EMAIL PROTECTED]>,
Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>Joshua Kugler <[EMAIL PROTECTED]> writes:
>>
>> self.me = []
>> for v in obj:
>> self.me.append(ObjectProxy(v))
>
>Note that is could be spelt:
>
>self.me = map(ObjectProxy, v)
It
> Consider reading the *second* paragraph about __setattr__ in section
> 3.4.2 of the Python Reference Manual.
if you are simply going to answer rtfm - might as well kept it to
yourself.
--
http://mail.python.org/mailman/listinfo/python-list
Hrvoje Niksic wrote:
> Hrvoje Niksic <[EMAIL PROTECTED]> writes:
>
> > Joshua Kugler <[EMAIL PROTECTED]> writes:
> >
> >> self.me = []
> >> self.me = {}
> >
> > Use "object.__setattr__(self, 'me') = []" and likewise for {}.
>
> Oops, that should of course be "object.__seta
Joshua Kugler <[EMAIL PROTECTED]> writes:
[...]
> self.me = []
> for v in obj:
> self.me.append(ObjectProxy(v))
Note that is could be spelt:
self.me = map(ObjectProxy, v)
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 25, 5:01 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote:
> My init lookslike this:
>
> def __init__(self, obj=None):
> if type(obj).__name__ in 'list|tuple|set|frozenset':
> self.me = []
> for v in obj:
> self.me.append(ObjectProxy(v))
>
John Machin wrote:
>> Is there a way to define self.me without it firing __setattr__?
> Consider reading the *second* paragraph about __setattr__ in section
> 3.4.2 of the Python Reference Manual.
Like I said in my original post, it was probably staring me right in the
face. I had read through a
"Joshua Kugler" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| OK, I'm sure the answer is staring me right in the face--whether that
answer
| be "you can't do that" or "here's the really easy way--but I am stuck.
I'm
| writing an object to proxy both lists (subscriptable iterable
Hrvoje Niksic <[EMAIL PROTECTED]> writes:
> Joshua Kugler <[EMAIL PROTECTED]> writes:
>
>> self.me = []
>> self.me = {}
>
> Use "object.__setattr__(self, 'me') = []" and likewise for {}.
Oops, that should of course be "object.__setattr__(self, 'me', [])".
--
http://mail.py
On Apr 26, 7:01 am, Joshua Kugler <[EMAIL PROTECTED]> wrote:
> OK, I'm sure the answer is staring me right in the face--whether that answer
> be "you can't do that" or "here's the really easy way--but I am stuck. I'm
> writing an object to proxy both lists (subscriptable iterables, really) and
> d
Joshua Kugler <[EMAIL PROTECTED]> writes:
> self.me = []
> self.me = {}
Use "object.__setattr__(self, 'me') = []" and likewise for {}.
--
http://mail.python.org/mailman/listinfo/python-list
OK, I'm sure the answer is staring me right in the face--whether that answer
be "you can't do that" or "here's the really easy way--but I am stuck. I'm
writing an object to proxy both lists (subscriptable iterables, really) and
dicts.
My init lookslike this:
def __init__(self, obj=None):
On May 16, 2:24 am, Bruno Desthuilliers wrote:
> 7stud a écrit :
>
>
>
> > "When you bind (on either a class or an instance) an attribute whose
> > name is not special...you affect only the __dict__ entry for the
> > attribute(in the class or instance, respectively)."
>
> > In light of that statem
On May 16, 12:34 am, 7stud <[EMAIL PROTECTED]> wrote:
> "When you bind (on either a class or an instance) an attribute whose
> name is not special...you affect only the __dict__ entry for the
> attribute(in the class or instance, respectively)."
>
> In light of that statement, how would one explain
7stud a écrit :
> "When you bind (on either a class or an instance) an attribute whose
> name is not special...you affect only the __dict__ entry for the
> attribute(in the class or instance, respectively)."
>
> In light of that statement, how would one explain the output of this
> code:
>
> clas
"When you bind (on either a class or an instance) an attribute whose
name is not special...you affect only the __dict__ entry for the
attribute(in the class or instance, respectively)."
In light of that statement, how would one explain the output of this
code:
class Test(object):
x = [1, 2]
18 matches
Mail list logo