On Sat, Oct 25, 2008 at 4:04 PM, Jeff Forcier <[EMAIL PROTECTED]> wrote: > On Sat, Oct 25, 2008 at 5:18 AM, Niklas Lindström <[EMAIL PROTECTED]> wrote: >> I thought it was your suggestion? :) > > Was it? If so, I apologize :( > >> Anyway, I agree it might be >> cleaner with e.g. a 'match' kw (that can take a string *or* >> precompiled regexp I suppose).. >> >> And skip the callable-tests for validate (if it's not None, it should >> be called). Not the least since we have no "callable" in Python 3.. >> >> Any votes on if I should rework it like this? > > I'd like to hear Christian's feedback,
I'd prefer to not get a new `match` keyword parameter. Instead I think I'd rather expose the/a Regexp constructor whos instances can be used as functions of str to bool for the purpose of validation. While callable() can be reimplemented in terms of the new Callable, I agree that the intent of that particular conditional is better expressed with `is not None`. Given the Regexp stuff above, then providing a validator that cannot be called is a bug and should cause an error message. Pretty messages > trace backs, though giving people the line number of their offense is a good thing. > and I think I may also do some > research to see what the general consensus is among the Python > community, about this sort of thing. I could see it going either way > but I'm sure someone smarter than me has already weighed the pluses > and minuses and figured out which is cleaner. > > -Jeff > > > _______________________________________________ > Fab-user mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/fab-user > -- Venlig hilsen / Kind regards, Christian Vest Hansen.
_______________________________________________ Fab-user mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/fab-user
