From 7a98827a23f1f42823ed4a28086f0439a9d00958 Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 13 Mar 2025 09:22:16 +0100 Subject: [PATCH] :sparkles: Enhance not_supported decorator to issue a SyntaxWarning for unsupported functions (#10) --- src/pycord_rest/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pycord_rest/app.py b/src/pycord_rest/app.py index bebd7f8..408bb6b 100644 --- a/src/pycord_rest/app.py +++ b/src/pycord_rest/app.py @@ -3,6 +3,7 @@ import functools import logging +import warnings from collections.abc import Callable, Coroutine from functools import cached_property from typing import Any, Never, override @@ -47,6 +48,11 @@ def not_supported[T, U](func: Callable[[T], U]) -> Callable[[T], U]: @functools.wraps(func) def inner(*args: T, **kwargs: T) -> U: logger.warning(f"{func.__qualname__} is not supported by REST apps.") + warnings.warn( + f"{func.__qualname__} is not supported by REST apps.", + SyntaxWarning, + stacklevel=2, + ) return func(*args, **kwargs) return inner