summaryrefslogtreecommitdiff
path: root/natsort/compat/locale.py
diff options
context:
space:
mode:
Diffstat (limited to 'natsort/compat/locale.py')
-rw-r--r--natsort/compat/locale.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/natsort/compat/locale.py b/natsort/compat/locale.py
index ccb5592..1edb67f 100644
--- a/natsort/compat/locale.py
+++ b/natsort/compat/locale.py
@@ -3,9 +3,8 @@
Interface for natsort to access locale functionality without
having to worry about if it is using PyICU or the built-in locale.
"""
-
-# Std. lib imports.
import sys
+import typing as t
# This string should be sorted after any other byte string because
# it contains the max unicode character repeated 20 times.
@@ -13,6 +12,11 @@ import sys
null_string = ""
null_string_max = chr(sys.maxunicode) * 20
+# This variable could be str or bytes depending on the locale library
+# being used, so give the type-checker this information.
+null_string_locale: t.Union[str, bytes]
+null_string_locale_max: t.Union[str, bytes]
+
# strxfrm can be buggy (especially on BSD-based systems),
# so prefer icu if available.
try: # noqa: C901