Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.

phoenixr-codes/maintenance.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maintenance.py: Utilities for Maintenance

Usage

todo(fn: Optional[Callable[P, R]] = None) -> Callable[P, NoReturn] | NoReturn
deprecated(
    message: Optional[str] = None,
    *,
    since: Optional[str] = None,
    new: Any = None,
    add_sphinx_directive: bool = False
) -> Callable[[Callable[P, R]], Callable[P, R]]

Parameters

message

Overrides the default warn message.

since

The version since when the object is deprecated.

new

The new object that replaces the deprecated one. This may be the object itself or its name as a string.

add_sphinx_directive

Adds the deprecated directive to the beginning of the docstring of the object.

Examples

def new():
    return 1

@deprecated(since="1.2.3.post4", new=new)
def old():
    return None
unstable(
    message: Optional[str] = None,
    *,
    until: Optional[str] = None
) -> Callable[[Callable[P, R]], Callable[P, R]]

Links

About

Utilities for Maintenance

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages