A few useful function/method decorators.
Class | cachedproperty |
Provides a cached property equivalent to the stacking of @cached and @property, but more efficient. |
Function | cached |
Simple decorator to cache result of method calls without args. |
Function | deprecate |
Decorator which emits a DeprecationWarning if any arguments specified are passed. |
Function | deprecate |
Decorator which emits a DeprecationWarning if any arguments specified are None or not passed at all. |
Function | path |
Return the given infer function wrapped to handle the path. |
Function | raise |
Undocumented |
Function | yes |
Undocumented |
Constant | _P |
Undocumented |
Type Variable | _R |
Undocumented |
str
= '3.0', **arguments: str
) -> Callable[ [ Callable[ _P, _R]], Callable[ _P, _R]]
:
(source)
¶
Decorator which emits a DeprecationWarning if any arguments specified are passed. Arguments should be a key-value mapping, with the key being the argument to check and the value being a string that explains what to do instead of passing the argument. To improve performance, only used when DeprecationWarnings other than the default one are enabled.
str
= '3.0', **arguments: str
) -> Callable[ [ Callable[ _P, _R]], Callable[ _P, _R]]
:
(source)
¶
Decorator which emits a DeprecationWarning if any arguments specified are None or not passed at all. Arguments should be a key-value mapping, with the key being the argument to check and the value being a type annotation as string for the value of the argument. To improve performance, only used when DeprecationWarnings other than the default one are enabled.
Return the given infer function wrapped to handle the path. Used to stop inference if the node has already been looked at for a given `InferenceContext` to prevent infinite recursion