updated from Atlas

This commit is contained in:
Luciano Ramalho
2021-08-07 00:44:01 -03:00
parent cbd13885fc
commit 01e717b60a
96 changed files with 580 additions and 1021 deletions

View File

@@ -58,7 +58,7 @@ Test ``find`` with single result::
Test ``find`` with two results::
>>> find('chess', 'queen', last=0xFFFF) # doctest:+NORMALIZE_WHITESPACE
>>> find('chess', 'queen', end=0xFFFF) # doctest:+NORMALIZE_WHITESPACE
U+2655 ♕ WHITE CHESS QUEEN
U+265B ♛ BLACK CHESS QUEEN

View File

@@ -2,11 +2,11 @@
import sys
import unicodedata
FIRST, LAST = ord(' '), sys.maxunicode # <1>
START, END = ord(' '), sys.maxunicode + 1 # <1>
def find(*query_words, first=FIRST, last=LAST): # <2>
def find(*query_words, start=START, end=END): # <2>
query = {w.upper() for w in query_words} # <3>
for code in range(first, last + 1):
for code in range(start, end):
char = chr(code) # <4>
name = unicodedata.name(char, None) # <5>
if name and query.issubset(name.split()): # <6>