[docs] lambdas are now required for declaring hooks in config.py

Bug #1294137 reported by Alfredo Deza
6
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)
Revision history for this message
Ryan Petrello (ryan-petrello) wrote :

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

Changed in pecan:
status: New → Invalid
Revision history for this message
Alfredo Deza (cy-launchpad-deactivatedaccount) wrote :

Then this ticket needs to be rephrased to indicate properly that the lambda is *new in version N.N.N*

summary: - [docs] lambdas are no longer required for declaring hooks in config.py
+ [docs] lambdas are now required for declaring hooks in config.py
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.