我倒是喜欢那种按需加载的东西做 lazy load。因为有些模块载入真的很慢啊（以及有时候根本用不到）


2014-04-05 19:34 GMT+08:00 Jiangge Zhang <notifications@github.com>:

> In flask_rbac/__init__.py:
>
> > @@ -131,9 +131,14 @@ def __init__(self, app=None, **kwargs):
> >          self.acl = AccessControlList()
> >          self.before_acl = {'allow': [], 'deny': []}
> >
> > +        try:
> > +            from flask.ext.login import current_user
> > +            self._user_loader = kwargs.get('user_loader', lambda: current_user)
> > +        except ImportError:
> > +            self._user_loader = kwargs.get('user_loader', None)
>
> @bcho <https://github.com/bcho>
>
>    - Putting the import statement in top level could expose errors
>    earlier.
>    - While we refactoring packages and modules, we could find the
>    dependencies quickly on the top of a module.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/shonenada/flask-rbac/pull/2/files#r11321038>
> .
>