Skip to content

Commit

Permalink
disable copy of docstring from InteractiveClean to run_iclean because…
Browse files Browse the repository at this point in the history
… CASA currently only supports python 3.8
  • Loading branch information
schiebel committed Feb 5, 2024
1 parent d348422 commit 3851c63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion casagui/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from ..utils import copydoc
initialize_session()

@copydoc(InteractiveClean)
#@copydoc(InteractiveClean)
def run_iclean( *args, **kwargs ):
ic = InteractiveClean( *args, **kwargs )
return ic( )
30 changes: 16 additions & 14 deletions casagui/utils/_copydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@
########################################################################
'''Reuse doc string'''

from typing import Callable, TypeVar, ParamSpec

P = ParamSpec("P")
T = TypeVar("T")

def copydoc(src: Callable[P, T]):
"""Copy documentation from src"""

def decorator(dest: Callable) -> Callable[P, T]:
dest.__doc__ = src.__doc__
return dest

return decorator

# ParamSpec is available with Python >= 3.10
#from typing import Callable, TypeVar, ParamSpec
#
#P = ParamSpec("P")
#T = TypeVar("T")
#
def copydoc(src):
#def copydoc(src: Callable[P, T]):
# """Copy documentation from src"""
#
# def decorator(dest: Callable) -> Callable[P, T]:
# dest.__doc__ = src.__doc__
# return dest
#
# return decorator
pass

0 comments on commit 3851c63

Please sign in to comment.