diff options
author | Seth M Morton <seth.m.morton@gmail.com> | 2016-04-11 22:08:07 -0700 |
---|---|---|
committer | Seth M Morton <seth.m.morton@gmail.com> | 2016-04-12 20:03:19 -0700 |
commit | 1ab6abf3901143f2dc05b0f6817ee405dd103284 (patch) | |
tree | c17bd2cc4338a9eb065ac3eacbfeebc66f20ea42 /natsort/ns_enum.py | |
parent | 13f4865d4458fce52b7c8892091a52bfcf3f3a9e (diff) | |
download | natsort-1ab6abf3901143f2dc05b0f6817ee405dd103284.tar.gz |
_num_splitter is now iterable-based (eliminating TYPESAFE!).
The _num_splitter function now uses iterables/generators and function
chaining. This will reduce the overall number of loops through the
results.
A side benefit is it is now cheap to perform what the _py3_safe function
was doing, so this is done always by default. The old TYPESAFE option
to ns is now a no-op.
Diffstat (limited to 'natsort/ns_enum.py')
-rw-r--r-- | natsort/ns_enum.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/natsort/ns_enum.py b/natsort/ns_enum.py index fdaaf88..72bf4c6 100644 --- a/natsort/ns_enum.py +++ b/natsort/ns_enum.py @@ -110,12 +110,8 @@ class ns(object): 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 - Try hard to avoid "unorderable types" error on Python 3. It - is the same as setting the old `py3_safe` option to `True`. - This is only needed if using ``SIGNED`` or if sorting by - ``FLOAT``. You shouldn't need to use this unless you are using - ``natsort_keygen``. *NOTE:* It cannot resolve the ``TypeError`` - from trying to compare `str` and `bytes`. + Deprecated as of `natsort` version 5.0.0; this option is now + a no-op because it is always true. Notes ----- @@ -142,6 +138,7 @@ class ns(object): # Sort algorithm "enum" values. _ns = { + 'TYPESAFE': 0, 'T': 0, 'INT': 0, 'I': 0, 'FLOAT': 1, 'F': 1, 'UNSIGNED': 0, 'U': 0, @@ -158,7 +155,6 @@ _ns = { 'UNGROUPLETTERS': 256, 'UG': 256, 'CAPITALFIRST': 256, 'C': 256, 'NANLAST': 512, 'NL': 512, - 'TYPESAFE': 2048, 'T': 2048, } # Populate the ns class with the _ns values. for x, y in _ns.items(): |