MCPcopy Create free account
hub / github.com/EasyIME/PIME / configure

Method configure

python/python3/tornado/util.py:310–324  ·  view source on GitHub ↗

Sets the class to use when the base class is instantiated. Keyword arguments will be saved and added to the arguments passed to the constructor. This can be used to set global defaults for some parameters.

(cls, impl, **kwargs)

Source from the content-addressed store, hash-verified

308
309 @classmethod
310 def configure(cls, impl, **kwargs):
311 # type: (Union[None, str, Type[Configurable]], Any) -> None
312 """Sets the class to use when the base class is instantiated.
313
314 Keyword arguments will be saved and added to the arguments passed
315 to the constructor. This can be used to set global defaults for
316 some parameters.
317 """
318 base = cls.configurable_base()
319 if isinstance(impl, str):
320 impl = typing.cast(Type[Configurable], import_object(impl))
321 if impl is not None and not issubclass(impl, cls):
322 raise ValueError("Invalid subclass of %s" % cls)
323 base.__impl_class = impl
324 base.__impl_kwargs = kwargs
325
326 @classmethod
327 def configured_class(cls):

Callers

nothing calls this directly

Calls 2

import_objectFunction · 0.85
configurable_baseMethod · 0.45

Tested by

no test coverage detected