On 6/25/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Russ: can you see if I've overlooked any problem there, please. It took > a little while to track everything down and my brain may have gotten > twisted in the process.
The anti-model-duplication logic makes sense to me from what I understand of the problem, everything still works for me locally, and it seems to have fixed Ivan's problem. I'm happy to call this a victory. > Also, I left it alone for now and I realise you > were just cutting-and-pasting, but __import__ takes dictionaries as the > second and third arguments (globals() and locals(), basically, although > the third arg is essentially ignored); why are we passing in strings??? Honest Mum! - It was like that when I got here :-) I can't think of any reason why strings are being used for globals and locals - running a quick check, using None, {} and actual calls to globals() and locals() in place of the empty strings all work equally well (or, at least, don't cause the regression tests to fail). Looking at the Python library docs, it almost seems that the globals/locals parameters don't matter. Quoting http://docs.python.org/lib/built-in-funcs.html#l2h-6: "In fact, the standard implementation does not use its locals argument at all, and uses its globals only to determine the package context of the import statement." Given that we're doing our own package context magic, it looks like we could provide almost anything with these two parameters without affecting behaviour of the model loader. Unless anyone can point to a specific problem that is caused by the empty strings, I'm happy to leave this in the "ain't broke, don't fix it" category. Russ %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---