Skip to content

Commit 5eec37c

Browse files
inline argument validation
1 parent 8838962 commit 5eec37c

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

teeplot/teeplot.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,6 @@ def teed(*args, **kwargs):
380380
saveit()
381381

382382

383-
def validate_teewrap_kwargs(teeplot_kwargs: dict[str, object]):
384-
if not all(k.startswith("teeplot_") for k in teeplot_kwargs):
385-
raise ValueError(
386-
"The `teewrap` decorator only accepts teeplot_* keyword arguments"
387-
)
388-
389-
390383
def teewrap(
391384
**teeplot_kwargs: object,
392385
):
@@ -398,7 +391,10 @@ def teewrap(
398391
the same across function calls. For printing attributes on a per-call basis,
399392
see `teeplot_outinclude` in `teeplot.tee`.
400393
"""
401-
validate_teewrap_kwargs(teeplot_kwargs)
394+
if not all(k.startswith("teeplot_") for k in teeplot_kwargs):
395+
raise ValueError(
396+
"The `teewrap` decorator only accepts teeplot_* keyword arguments"
397+
)
402398

403399
def decorator(f: typing.Callable):
404400
@functools.wraps(f)

0 commit comments

Comments
 (0)