def does_string_have_currency_mark(s): return bool(set(s) & set(unicode_categories['Sc'])
def does_string_have_numeric_digit(s): ... ... and so on. Those seem like questions one asks often enough. Not every day, but more than never. On Fri, Jun 2, 2023 at 4:59 PM Chris Angelico <ros...@gmail.com> wrote: > > On Sat, 3 Jun 2023 at 06:54, David Mertz, Ph.D. <david.me...@gmail.com> wrote: > > > > If we're talking PyPI, it would be nice to have: > > > > unicode_categories = {"Zs": [...], "Ll": [...], ...} > > > > For all the various categories. It would just take one pass through > > all the characters to generate it, but then every category would be > > fast to access later. On the other hand, it's a few lines of code > > with a lazy import. Probably not enough code to put on PyPI. > > > > Question: What is the advantage of having this? What are the use-cases? > > ChrisA > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/4ZFJWXPYS6TWU7XBA5G63RY5H4KGOSW2/ > Code of Conduct: http://python.org/psf/codeofconduct/ -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/ALTCCL6LRXS75PDVSZBGS5RGOHXJLPFC/ Code of Conduct: http://python.org/psf/codeofconduct/