On 6 March 2013 12:01, Peter Waller <[email protected]> wrote:
> The problem is that I want my users *to use pyramid*, i.e, I want to take
> advantage of the wonderful documentation and framework of Pyramid. That
> means that I want to build my application on top of it. The way I see it,
> there is a fundamental conflation of KeyError and "no resource" here which
> leads to an unresolvable decision - "is it an error, or a resource which
> doesn't exist?".

You've got a point.

It's a fundamental problem with APIs that try to mimic the built-in
dict- and/or sequence types, what's sometimes called being "pythonic".
Another example is the `property` decorator (and descriptors in
general) – if you raise an `AttributeError`, then it's not obvious
what the error means.

But the solution is probably just awareness in this case. It's
unlikely that the interface will change. It's a "gotcha" :-).

\malthe

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to