summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth M Morton <seth.m.morton@gmail.com>2018-11-10 13:31:04 -0800
committerSeth M Morton <seth.m.morton@gmail.com>2018-11-18 20:25:23 -0800
commit6982bad8c23d3c22e6b5160d7f7ff193d39fc350 (patch)
treea2fc58d0325f016b1519dc6caedbafb2ba0c5227
parent78ad1f24a69a9ef0059ac088fa6e203ab431094b (diff)
downloadnatsort-6982bad8c23d3c22e6b5160d7f7ff193d39fc350.tar.gz
Remove ns.TYPESAFE and ns.DIGIT
These are deprecated and no longer do anything.
-rw-r--r--natsort/ns_enum.py26
-rw-r--r--tests/test_utils.py2
2 files changed, 1 insertions, 27 deletions
diff --git a/natsort/ns_enum.py b/natsort/ns_enum.py
index c79884b..8605574 100644
--- a/natsort/ns_enum.py
+++ b/natsort/ns_enum.py
@@ -175,16 +175,10 @@ class _NSEnum(collections.namedtuple("_NSEnum", enum_fields.keys())):
If an NaN shows up in the input, this instructs `natsort` to
treat these as +Infinity and place them after all the other numbers.
By default, an NaN be treated as -Infinity and be placed first.
- TYPESAFE, T
- Deprecated as of `natsort` version 5.0.0; this option is now
- a no-op because it is always true. It will be removed in `natsort`
- version 6.0.0.
VERSION, V
Deprecated as of `natsort` version 5.0.0; this option is now
a no-op because it is the default. It will be removed in `natsort`
version 6.0.0.
- DIGIT, D
- Same as `VERSION` above. It will be removed in `natsort` version 6.0.0.
Notes
-----
@@ -212,26 +206,6 @@ class _NSEnum(collections.namedtuple("_NSEnum", enum_fields.keys())):
warnings.warn(self._msg.format("VERSION"), DeprecationWarning, stacklevel=2)
return 0
- @property
- def T(self): # noqa: N802
- warnings.warn(self._msg.format("T"), DeprecationWarning, stacklevel=2)
- return 0
-
- @property
- def TYPESAFE(self): # noqa: N802
- warnings.warn(self._msg.format("TYPESAFE"), DeprecationWarning, stacklevel=2)
- return 0
-
- @property
- def D(self): # noqa: N802
- warnings.warn(self._msg.format("D"), DeprecationWarning, stacklevel=2)
- return 0
-
- @property
- def DIGIT(self): # noqa: N802
- warnings.warn(self._msg.format("DIGIT"), DeprecationWarning, stacklevel=2)
- return 0
-
# Here is where the instance of the ns enum that will be exported is created.
# It is a poor-man's singleton.
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 0413d48..fca0d7d 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -97,7 +97,7 @@ def test_ns_enum_values_and_aliases(alg, value_or_alias):
assert alg == value_or_alias
-@pytest.mark.parametrize("alg", ["V", "VERSION", "T", "TYPESAFE", "D", "DIGIT"])
+@pytest.mark.parametrize("alg", ["V", "VERSION"])
def test_deprecated_ns_enum_values_and_aliases_produce_warning(alg):
with pytest.warns(DeprecationWarning, match="please simply remove"):
assert getattr(ns, alg) == 0