[docs] lambdas are now required for declaring hooks in config.py
Bug #1294137 reported by
Alfredo Deza
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pecan |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The current docs mention in the examples that you must use a lambda for hooks:
app = {
'root' : '...'
# ...
'hooks': lambda: [SimpleHook()]
}
But that is *new* behavior, yet nothing mentions that. "New in version N.N.N" is what I would expect the least for backwards incompatible changes like this one.
Changed in pecan: | |
assignee: | nobody → Alfredo Deza (cy-launchpad) |
To post a comment you must log in.
You've got it backwards. The old behavior was a list of hooks. The new behavior is a lambda. We implemented it this way to prevent people from shooting themselves in the foot with circular dependencies. The current documentation reflects the "best practice".