What is the intendend semantic wrt to __xxxattr__ caching:
x.__dict__['__getattr__'] = iga # 1.
x.__getattr__ = iga # 2.
X.__dict__['__getattr__'] = cga # 3.
X.__getattr__ = cga # 4.
for the manual
with all the variants x.a should fail, they should have
no effect. In practice 4. work.
Is that an implementation manual mismatch, is this indented, is there
code around using 4. ?
I'm asking this because jython has differences/bugs in this respect?
I imagine that 1.-4. should work for all other __magic__ methods
(this should be fixed in jython for some methods),
OTOH jython has such a restriction on __del__ too, and this one cannot
be removed (is not simply a matter of caching/non caching).
regards, Samuele Pedroni.
> > You end up with a camel. You know, a horse designed by committee?
> Yup! But that's the camel Intel rides to the bank, so it will probably grow
> more humps, on which to hang more bags of gold.
Guido is only one week on vacation and soon heretical words show up here. ;-)
sorry, couldn't resist, Peter
Good for the soul!
[mailto:email@example.com]On Behalf Of Ron Stephens
Sent: Thursday, May 31, 2001 7:12 PM
Subject: CP4E and Python newbies, it works!
I am a complete newbie, and with a very low programming IQ. Although I
had programmed a little in college thirty years ago, in Basic, PL/1 and
a very little assembler, and fooled around in later years on PC's at
home with Basic, then tried PERL, then an effort at Java, they were all
too much trouble to really use to program, given that it was a *hobby*
that was supposed to be fun. After all, I have a demanding day job that
has nothing to do with software, that requires extensive travel, and
four kids, a wife, two dogs, and a cat. Java et al, by the time I had
digested a couple of books and put in a lot of hours, was just no fun at
all to program; and I had to look in the book every other line of code
just to recall the syntax etc.; I could not keep it in my head.
Now, four months into Python, after being attracted by reading a blurb
about Guido van Rossum's Computer Programming for Everybody project, I
am in awe of his achievement. I am having fun; and if I can do so then
almost anyone can. I am really absent minded, lazy, and not good at
detail. Yet I have done the following in four months, and I believe
Python therefore has the potential to open up programming to a much
wider audience for a lot of people, which is nice:
1. I have written a half dozen scripts that are meaningful to me in
Python, more than I ever accomplished with any other language.
2. I am able to have fun by sitting down in the evening, or especially
on a weekend, and just programming in Python. The syntax and keywords
are gratifyingly just in my head, enough anyway that I can just program
like I am having a conversation, and check the details later for errors
etc. This is the most satisfying thing of all.
3. I find the debugger just works; magically, it helps me turn my
scripts into actual working programs, simply by rather mindlessly
following the road laid out for me by using the debugger.
4. I have pleasurably read more Python books from front cover to back
than I care to admit. I must be enjoying myself ;-)))
5. I am exploring Jython, which is also pleasurable. After fooling
around with Java a couple of years ago, it is really a kick to see
jython generating such detailed Java code for me, just as if I had
written it (but it would have taken me untold pain to actually do so in
Java). Whether or not I actually end up using the java code so
generated, I still am enjoying the sheer experience.
6. I have Zope and other things to look forward to.
7. I am able to enjoy the discussions on this newsgroup, even though
they are over my head technically. I find them intriguing.
Now, I may never actually accomplish anything truly useful by my
programming. But I am happy. I hope that others, younger and brighter
than myself, who have an interest in programming, but need the right
stimulus to get going, will find Python and produce programs of real
value. I think Guido van Rossum and his team should be very proud of
what they are enabling.
The CP4E idea is alive and well. My hat's off to Guido and the whole
community which he has spawned, especially those on this newsgroup. I am
humbled and honored to read your erudite technical discussions, as a
voyeur of mysteries and wonders I can only dimly see on the horizon, but
that nonetheless fill me with mental delight.