Tt does break existing properly written python code (and is very non- pythonesque). Think:
try: target = request.args[0] except: response.flash = 'No target specified' return do_something(target) If this is an issue for people, I think they should improve their python skills (learn exceptions, for arg in request.args constructs), and not fight the language by framework-specific workarounds. They will benefit from it much more on the long run (as they are bound to have the same IndexError or KeyError problem anyway, just someplace else). My 0.02c. On May 23, 3:30 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > A recurrent problem in web2py is that request.args is a list and if no > request.args are provided > request.args[0] returns a ticket. To avoid this I have a created a new > class called storage.List and not request.args[i] returns None if the > index i is out of bounds. > > This does not break anybody's code but avoids the ticket if you are > not checking that i is within bounds. > > Massimo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---