Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fbbbc51

Browse files
committed
added deprecation warning function
1 parent d5f3714 commit fbbbc51

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/matplotlib/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,6 +1501,20 @@ def test(verbosity=1):
15011501
if old_backend.lower() != 'agg':
15021502
use(old_backend)
15031503

1504+
def deprecated_get_set(function, to_use):
1505+
"""Fuction to deprecate the getters and setter for a class
1506+
argument.
1507+
1508+
Parameter
1509+
---------
1510+
- function: function
1511+
The function to deprecate.
1512+
- to_use: string
1513+
The argument to use instead of the deprecated function
1514+
"""
1515+
msg = "{} is deprecated, please use the {} argument"
1516+
msg = msg.format(function.__name__, to_use)
1517+
warnings.warn(msg, mplDeprecation, stacklevel=1)
15041518
return success
15051519

15061520
test.__test__ = False # nose: this function is not a test

0 commit comments

Comments
 (0)