Fix docstring

This commit is contained in:
skizzerz 2015-11-15 17:06:46 -06:00
parent a26f912f6e
commit 8a36dd8442

View File

@ -3,21 +3,26 @@ import inspect
from src.decorators import handle_error from src.decorators import handle_error
""" This module introduces two decorators - @proxy.stub and @proxy.impl """ This module introduces two decorators - @proxy.stub and @proxy.impl
@proxy.stub is used to decorate a stub method that should be filled in @proxy.stub is used to decorate a stub method that should be filled in
with an implementation in some other module. Calling the stub method with an implementation in some other module. Calling the stub method
calls the implementation method in the other module instead of the stub calls the implementation method in the other module instead of the stub
method itself (or raises a NotImplementedError if no such method itself (or raises a NotImplementedError if no such
implementation exists) implementation exists)
@proxy.impl is used to define a previously-declared stub with an actual @proxy.impl is used to define a previously-declared stub with an actual
implementation to call -- the signature for the implementation must implementation to call -- the signature for the implementation must
exactly match the signature for the stub (enforced for Python 3.3+). exactly match the signature for the stub (enforced for Python 3.3+).
Attempting to implement a non-existent stub is an error, as is trying Attempting to implement a non-existent stub is an error, as is trying
to re-implement a stub that is already implemented. to re-implement a stub that is already implemented.
Example: Example:
(foo.py) (foo.py)
@proxy.stub @proxy.stub
def my_method(foo, bar=10): def my_method(foo, bar=10):
pass pass
(bar.py) (bar.py)
@proxy.impl @proxy.impl
def my_method(foo, bar=10): def my_method(foo, bar=10):