On 6 March 2013 10:51, Arndt Droullier <[email protected]> wrote:

> I thought about this point some time ago but I don't think it is a problem
> in general:
>
- if you write a unit test you are likely to test your code without
> traverser so you will get plain Key errors
>

Since it's my users writing code I can't enforce that they write unit
tests. I know that they won't, they're an inexperienced audience.


> - __getitem__ is not the place to put your application logic
>

.. I don't understand this statement at all. Then why have traversal at
all?! The basic premise of my application is to give things URLs which
currently do not, so I'm pretty heavily invested in using traversal for
complex purposes.


> If you want to extend pyramid or create a new framework on top you need to
> provide some code
> to be used by users. Either as base classes, decorators or pyramid level
> replacements. This doesn't
> mean users cannot use __getitem__.
>

I already do this heavily. I have several decorators which allow you to
modify the behaviour significantly.

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?".

In my application it's not necessarily clear when a resource doesn't exist
(which should, but there is an error), because it could just be one thing
on a page of hundreds of things not showing up. This can lead to very
problematic and hard to debug cases for the user.

This is very unfortunate for me, because other than this one horrible edge
case (and user trap), I'm really pleased with the application and I want to
share it (and pyramid) with the world.

-- 
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