Pylons/pyramid — Issue #464: @decorator.reify not doing what is expected?
Author: danosaure
Created: 2012-03-08 16:37:34+00:00
State: open

I got a request class:

```python
class My_Request(request.Request):
def user_info(self):
return some_function_to_get_info(self)
```

If I apply the `@decorator.reify`, I don't get the information from my `some_function_to_get_info`. If I change that decorator and simply use the python's `@property`, I get what I want.

Is it a bug in Pyramid 1.2 or I am using it incorrectly.

The way I detect the problem is that when calling `request.user_info` in a `BeforeRender`, I do get the wanted information, but then, in the template, if I call `${request.user_info}`, I get `None`.

Even more weird is that it only happens on the first call of the page. If I reload the page, the info is displayed correctly. So I end up using `@property` instead of the suggested `@decorator.reify`.