On Feb 1, 2011, at 12:16 PM, Massimo Di Pierro wrote: > > I agree with Armin that in the case of exec (and web2py uses exec), > the self references are created whether you want them or not. That > means one should not define classes in Models and Controllers. I have > issued that warning already to our users and, I have never seen this > being a problem in practice. > > Nothing in life is perfect and every design decision has a tradeoff. > > What would really be useful to us is an example of how to overcome > that problem by showing how to break those implicit self references.
I agree. This is a subtle problem that isn't all that obvious to most of us, including me. I've got classes defined in models (it's sort of the obvious place to define custom validators, for example), and I'd like to understand the implications better than I do.