def provide_adapter(factory, adapts=None, provides=None, name=_BLANK):
"""Register an adapter globally
An adapter is registered to provide an interface with a name
for some number of object types. If a factory implements only
one interface, then the provides argument can be omitted and
the provided interface will be used. (In this case, a provides
argument can still be provided to provide a less specific
interface.)
If the factory has an adapts declaration, then the adapts
argument can be omitted and the declaration will be used. (An
adapts argument can be provided to override the declaration.)
CAUTION: This API should only be used from test or
application-setup code. This API shouldn't be used by regular
library modules, as component registration is a configuration
activity.
"""
评论列表
文章目录