On Tue, 2006-05-16 at 16:26 -0500, Adrian Holovaty wrote:
> On 5/15/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> > A friend hit the standard problems with trying to use Django's templates
> > in another application at his work last week. So we sat down on Saturday
> > and polished Luke Plant's existing patch a little. I have put the new
> > patch into ticket #1321.
> >
> > I would appreciate some review of this, since I believe it is pretty
> > close to something that is complete. There are documentation updates in
> > the patch, so I won't go into too much detail: will be a good test of
> > whether the docs make sense. It is all still heavily based off the
> > earlier work of Luke and Fredrik Lundh.
> 
> This is excellent stuff! I've committed it to trunk. Thanks very much
> to all who contributed to the patch.
> 
> One tiny question:
> 
> Why is LazySettings.__setattr__() using this:
> 
>     self.__dict__['_target'] = value
> 
> ...instead of this?
> 
>     self._target = value

As Luke mentioned in the ticket report (just posting here for the
archives), it's because in Python

        self._target = value
        
is implemented as

        self.__setattr__('_target', value)

for attributes that are not specifically attached to the class at
construction time. See also: "infinite loop". I started off with the
same thinking you did, stripped all that stuff out and then spent half
an hour rediscovering that Luke is pretty smart and had no doubt been
through the same process.

Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to