當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python matplotlib delete_parameter用法及代碼示例

本文簡要介紹 python 語言中 matplotlib._api.deprecation.delete_parameter 的用法。

用法

matplotlib._api.deprecation.delete_parameter(since, name, func=None, **kwargs)

指示 func 的參數 name 正在被棄用的裝飾器。

func 的實際實現應在其簽名中保留 name 參數,或接受 **kwargs 參數(將通過該參數傳遞 name)。

不推薦使用的參數之後的參數實際上變成了僅關鍵字(因為它們不能在不觸發不推薦使用的參數的 DeprecationWarning 的情況下按位置傳遞),並且應該在已過棄用期並刪除不推薦使用的參數後進行標記。

sincenamefunc 之外的參數僅是關鍵字,並轉發到 warn_deprecated

例子

@_api.delete_parameter("3.1", "unused")
def func(used_arg, other_arg, unused, more_args): ...

相關用法


注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib._api.deprecation.delete_parameter。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。