On Sat, Jan 29, 2011 at 8:55 PM, Jari Pennanen <[email protected]> wrote: > Certainly something new for me. > > That does look like a rather cool. Essentially if that works one could > save even the request object to thread "global" and it would be > accessible anywhere.
... and this is one of the biggest reasons why Django doesn't encourage the practice of using threadlocals. If an engineer came to their supervisor with a problem and said "I'm going to fix this problem with a global variable", they would be soundly beaten by any supervisor worth their salt. Somehow, because the name has been changed to "threadlocal", global variables have suddenly become acceptable. Every single problem associated with using global variables exists with threadlocals -- and then a few more. They *can* be used successfully. However, in almost every case, they can also be avoided entirely with a good dose of rigorous engineering. I *strongly* advise against the use of this technique. Yours, Russ Magee %-) -- 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?hl=en.
