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 showed me
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.__setattr__(self, 'me', []).
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
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 could also 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 find
[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 spelt:
self.me =
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):
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
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
dicts.
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', []).
--
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 iterables,
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 bit
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))
elif
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
14 matches
Mail list logo