On Jul 20, 2009, at 9:04 AM, Yarko Tymciurak wrote: > On Mon, Jul 20, 2009 at 9:33 AM, Jonathan Lundell > <[email protected]> wrote: > > On Jul 20, 2009, at 7:22 AM, mdipierro wrote: > > > > > The error is here: > > > > IS_NOT_IN_DB(db,db.strona) > > > > the second argument has to be a field, not a table. > > Would it be an overcomplication to sprinkle a few asserts throughout > web2py to help out with this kind of thing? I can imagine it'd speed > development, without having an impact on production performance. > Asserts are useful documentation as well. > > ... there might be a better way; first - this _should_ be > development time; even a DEBUGLEVEL check in the code would be > messy.... > > A static web2py specific set of tests (is this one of the reasons > others don't like doctests as compared to nose or pyunit?) to check > these ... a web2py-lint sort of thing might be useful... > > (I haven't looked at this, just thinking out loud...)
There's apparently no overhead if -O is used, though I have no idea how practical that is with web2py. > These equivalences assume that __debug__ and AssertionError refer to > the built-in variables with those names. In the current > implementation, the built-in variable __debug__ is True under normal > circumstances, False when optimization is requested (command line > option -O). The current code generator emits no code for an assert > statement when optimization is requested at compile time. Note that > it is unnecessary to include the source code for the expression that > failed in the error message; it will be displayed as part of the > stack trace. http://docs.python.org/reference/simple_stmts.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

