mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-11 04:12:45 +00:00
[compat] Make casefold private
* if required, not supported: `from youtube_dl.casefold import _casefold as casefold`
This commit is contained in:
parent
5975d7bb96
commit
26b6f15d14
@ -10,9 +10,10 @@ from .compat import (
|
||||
# https://github.com/unicode-org/icu/blob/main/icu4c/source/data/unidata/CaseFolding.txt
|
||||
# In case newly foldable Unicode characters are defined, paste the new version
|
||||
# of the text inside the ''' marks.
|
||||
# The text is expected to have only blank lines andlines with 1st character #,
|
||||
# The text is expected to have only blank lines and lines with 1st character #,
|
||||
# all ignored, and fold definitions like this:
|
||||
# `from_hex_code; space_separated_to_hex_code_list; comment`
|
||||
# `from_hex_code; status; space_separated_to_hex_code_list; comment`
|
||||
# Only `status` C/F are used.
|
||||
|
||||
_map_str = '''
|
||||
# CaseFolding-15.0.0.txt
|
||||
@ -1657,11 +1658,6 @@ _map = dict(
|
||||
del _map_str
|
||||
|
||||
|
||||
def casefold(s):
|
||||
def _casefold(s):
|
||||
assert isinstance(s, compat_str)
|
||||
return ''.join((_map.get(c, c) for c in s))
|
||||
|
||||
|
||||
__all__ = [
|
||||
'casefold',
|
||||
]
|
||||
|
@ -44,7 +44,7 @@ try:
|
||||
compat_str.casefold
|
||||
compat_casefold = lambda s: s.casefold()
|
||||
except AttributeError:
|
||||
from .casefold import casefold as compat_casefold
|
||||
from .casefold import _casefold as compat_casefold
|
||||
|
||||
try:
|
||||
import collections.abc as compat_collections_abc
|
||||
|
Loading…
Reference in New Issue
Block a user