summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth M Morton <seth.m.morton@gmail.com>2018-11-17 17:29:10 -0800
committerSeth M Morton <seth.m.morton@gmail.com>2018-11-17 17:55:56 -0800
commit1e9a79613136c91e7d60c6b7274ad5fc317ea757 (patch)
tree8d124e45f7de0144a6f3a43f5834684920ae70e1
parentd9990d02e92ea0db6cbb5f89c9a573d8e4851228 (diff)
downloadnatsort-1e9a79613136c91e7d60c6b7274ad5fc317ea757.tar.gz
args_to_enum warnings now state removal in 6.0.0
Previously it just stated that the keyword arguments were deprecated, now it says when they will be removed.
-rw-r--r--natsort/utils.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/natsort/utils.py b/natsort/utils.py
index 496904a..8a56cfd 100644
--- a/natsort/utils.py
+++ b/natsort/utils.py
@@ -801,24 +801,27 @@ def args_to_enum(**kwargs):
x = set(kwargs) - set(keys)
raise TypeError("Invalid argument(s): " + ", ".join(x))
if "number_type" in kwargs and kwargs["number_type"] is not int:
- msg = "The 'number_type' argument is deprecated as of 3.5.0, "
+ msg = "The 'number_type' argument is deprecated as of 3.5.0 "
+ msg += "and will be removed in 6.0.0, "
msg += "please use 'alg=ns.FLOAT', 'alg=ns.INT', or 'alg=ns.VERSION'"
warn(msg, DeprecationWarning)
alg |= ns.FLOAT * bool(kwargs["number_type"] is float)
alg |= ns.INT * bool(kwargs["number_type"] in (int, None))
alg |= ns.SIGNED * (kwargs["number_type"] not in (float, None))
if "signed" in kwargs and kwargs["signed"] is not None:
- msg = "The 'signed' argument is deprecated as of 3.5.0, "
+ msg = "The 'signed' argument is deprecated as of 3.5.0 "
+ msg += "and will be removed in 6.0.0, "
msg += "please use 'alg=ns.SIGNED'."
warn(msg, DeprecationWarning)
alg |= ns.SIGNED * bool(kwargs["signed"])
if "exp" in kwargs and kwargs["exp"] is not None:
- msg = "The 'exp' argument is deprecated as of 3.5.0, "
+ msg = "The 'exp' argument is deprecated as of 3.5.0 "
+ msg += "and will be removed in 6.0.0, "
msg += "please use 'alg=ns.NOEXP'."
- warn(msg, DeprecationWarning)
alg |= ns.NOEXP * (not kwargs["exp"])
if "as_path" in kwargs and kwargs["as_path"] is not None:
- msg = "The 'as_path' argument is deprecated as of 3.5.0, "
+ msg = "The 'as_path' argument is deprecated as of 3.5.0 "
+ msg += "and will be removed in 6.0.0, "
msg += "please use 'alg=ns.PATH'."
warn(msg, DeprecationWarning)
alg |= ns.PATH * kwargs["as_path"]