pecan/pecan — pull request #34 by alfredodeza (2011-11-21 01:09:52+00:00)
Title: Config get

I was working with the conf module from Pecan and had the need to do `conf.get('my_option')` because this is something that a user might or might not add to my application configuration.

I wanted to avoid doing something like this to circumvent the problem:

my_option = getattr(conf, 'my_option', None)

Since `conf` is a dict-like module, it makes sense to be able to expose something like `conf.get`.

This pull request is tested in `tests.test_conf.py`

Didn't think we should document this as `conf` is already reported as a dict-like object. But if the merge of this pull request warrants it, I can definitely add a few lines to explain it.

This pull request behaves more like a regular Python dict `get` (thanks Ryan). Somehow I missed out on the default behavior.

I also added a test for the new default feature.