summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth M Morton <seth.m.morton@gmail.com>2016-05-01 13:49:51 -0700
committerSeth M Morton <seth.m.morton@gmail.com>2016-05-01 13:49:51 -0700
commitdf00419f4e1a1c4ec469b4b3ae76f98cb7c12c3a (patch)
treeed2b97f5087e8b518e35c2887ae7cffd21d0cb04
parent707866c768a464d28a9a2242e63618e1289ec60b (diff)
downloadnatsort-df00419f4e1a1c4ec469b4b3ae76f98cb7c12c3a.tar.gz
Removed _fix_nan function.
The work of this function is now being done elsewhere.
-rw-r--r--natsort/utils.py14
-rw-r--r--test_natsort/test_utils.py11
2 files changed, 0 insertions, 25 deletions
diff --git a/natsort/utils.py b/natsort/utils.py
index 1647aa3..6c2362c 100644
--- a/natsort/utils.py
+++ b/natsort/utils.py
@@ -360,20 +360,6 @@ def chain_functions(functions):
return func
-def _fix_nan(ret, alg):
- """Detect an NaN and replace or raise a ValueError."""
- t = []
- for r in ret:
- if r != r:
- if alg & ns.NANLAST:
- t.append(float('+inf'))
- else:
- t.append(float('-inf'))
- else:
- t.append(r)
- return tuple(t)
-
-
def _do_decoding(s, encoding):
"""A function to decode a bytes string, or return the object as-is."""
try:
diff --git a/test_natsort/test_utils.py b/test_natsort/test_utils.py
index e48c3c5..06a87a6 100644
--- a/test_natsort/test_utils.py
+++ b/test_natsort/test_utils.py
@@ -25,7 +25,6 @@ from natsort.utils import (
_int_sign_re,
_do_decoding,
_path_splitter,
- _fix_nan,
chain_functions,
_parse_number_function,
_parse_bytes_function,
@@ -152,16 +151,6 @@ int_nolocale_group = (fast_int, False, True)
int_nolocale_nogroup = (fast_int, False, False)
-def test_fix_nan_converts_nan_to_negative_infinity_without_NANLAST():
- assert _fix_nan((float('nan'),), 0) == (float('-inf'),)
- assert _fix_nan(('a', 'b', float('nan')), 0) == ('a', 'b', float('-inf'))
-
-
-def test_fix_nan_converts_nan_to_positive_infinity_with_NANLAST():
- assert _fix_nan((float('nan'),), ns.NANLAST) == (float('+inf'),)
- assert _fix_nan(('a', 'b', float('nan')), ns.NANLAST) == ('a', 'b', float('+inf'))
-
-
def test_chain_functions_is_a_no_op_if_no_functions_are_given():
x = 2345
assert chain_functions([])(x) is x