morefunctools.notimplemented¶
Annotations¶
@overload
def notimplemented(enumtype: NotImplemented = NotImplemented.Default, message: Optional[str] = None) -> Callable[[Callable], Callable]:
...
@overload
def notimplemented(fn: Callable) -> Callable:
...
Notes¶
Denotes that a function is not implemented and, depending on the value of enumtype if specified, throw a warning or an error.
Parameters¶
enumtype: NotImplemented = NotImplemented.Default- Describes what should happen when the function is called.
NotImplemented.Defaultuses your message if any, orf"{fn.__qualname__} is not implemented."NotImplemented.Abstractusesf"{fn.__qualname__} is an abstract method, and therefore not implemented."NotImplemented.Developmentusesf"{fn.__qualname__} is in development, and not yet finished. Expect unfinished or broken behaviour."NotImplemented.Brokenusesf"{fn.__qualname__} is broken and may not function properly."message: Optional[str] = None- The warning message to display when the function is used. Only applied if
enumtypeisNotImplemented.Default
Return Value¶
N/A
Raises¶
N/A
Example usage¶
from morefunctools import notimplemented, NotImplemented
@notimplemented(NotImplemented.Development)
def test():
a = 1
b = 2
... # unfinished behaviour
def main():
test() # NotImplementedWarning: test is in development, and not yet finished. Expect unfinished or broken behaviour.