本文簡要介紹 python 語言中 matplotlib._api.deprecation.deprecated
的用法。
-
裝飾器將函數、類或屬性標記為已棄用。
當棄用類方法、靜態方法或屬性時,
@deprecated
裝飾器應該轉到under
@classmethod
和@staticmethod
(即deprecated
應該直接裝飾底層可調用對象),但over
@property
。當棄用旨在用作多繼承層次結構中的基類的類
C
時,C
must
定義__init__
方法(如果C
而是從其自己的基類繼承其__init__
,然後@deprecated
會在安裝自己的 (deprecation-emitting)C.__init__
時弄亂__init__
繼承。參數與
warn_deprecated
相同,但obj_type
如果裝飾類則默認為 'class',如果裝飾屬性則默認為 'attribute',否則為 'function'。例子
@deprecated('1.4.0') def the_function_to_deprecate(): pass
用法
matplotlib._api.deprecation.deprecated(since, *, message='', name='', alternative='', pending=False, obj_type=None, addendum='', removal='')
相關用法
- Python matplotlib deprecate_privatize_attribute用法及代碼示例
- Python matplotlib delete_parameter用法及代碼示例
- Python matplotlib define_aliases用法及代碼示例
- Python matplotlib disconnect用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.plot用法及代碼示例
- Python matplotlib Axes.semilogx用法及代碼示例
- Python matplotlib Axes.semilogy用法及代碼示例
- Python matplotlib MovieWriterRegistry.register用法及代碼示例
- Python matplotlib PolyQuadMesh.set_hatch用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib._api.deprecation.deprecated。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。