On 9/11/07, Marty Alchin <[EMAIL PROTECTED]> wrote:

> That said, I'd also recommend that if you're going to draw any
> parallels with unittest assertions, you should probably do it
> reliably. Your validate_exception() example was completely unreadable
> to me, because it works quite differently than the one in unittest.


I agree with you on readability, and my proposal about function signature is
not final, and probably can do well with further inputs.

About validate_exception, this is the signature of the corresponding method
in unittest:

*assertRaises*( exception, callable, *args, **kw)
they have removed message, but since args and kw will be passed to callable,
these are the only two possible options for adding message:

validate_raises(exception, msg, callable, *args, **kw) or
validate_raises(msg, exception, callable, *args, **kw). I picked the former,
and do not understand how it has become completely unreadable.

It's not terribly Pythonic, but people use it because it works well.


This is my point, a set of convenience function, well thought out, will be
used by python programmer no matter even if it is as bad as looking like
coming from java. The challenge is probably to figure out function names and
signatures that are intuitive as best as we can.

Support of server side form validation is a strong point for django, and a
rich libraries of such functions would only make things better. Batteries
included thing. I have created a wiki page[1] with proposed function names
and signatures, please go through it, and see if they make sense, and might
be useful for django.

[1]: http://code.djangoproject.com/wiki/ValidationHelperFunctionsProposal

-- 
Amit Upadhyay
http://www.amitu.com/blog/
+91-9820-295-512

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" 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/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to