Replacing static provider documentation examples with literalincludes
This commit is contained in:
parent
139cdd2d2e
commit
223e494d56
|
@ -14,29 +14,5 @@ readability and providing object's type.
|
|||
|
||||
Example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
"""`Static` providers example."""
|
||||
|
||||
from objects.providers import Class
|
||||
from objects.providers import Object
|
||||
from objects.providers import Function
|
||||
from objects.providers import Value
|
||||
|
||||
|
||||
# Provides class - `object`:
|
||||
cls_provider = Class(object)
|
||||
assert cls_provider() is object
|
||||
|
||||
# Provides object - `object()`:
|
||||
object_provider = Object(object())
|
||||
assert isinstance(object_provider(), object)
|
||||
|
||||
# Provides function - `len`:
|
||||
function_provider = Function(len)
|
||||
assert function_provider() is len
|
||||
|
||||
# Provides value - `123`:
|
||||
value_provider = Value(123)
|
||||
assert value_provider() == 123
|
||||
|
||||
.. literalinclude:: ../../examples/providers/static.py
|
||||
:language: python
|
||||
|
|
Loading…
Reference in New Issue