[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here's my implementation: from unicodedata import name from unicodedata import lookup as _lookup from fnmatch import translate from re import compile, I _NAMES = None def getnames(): global _NAMES if _NAMES is None: _NAMES = [] for i

[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: I love the idea, but dislike the proposed interface. As a general rule of thumb, Guido dislikes "constant bool parameters", where you pass a literal True or False to a parameter to a function to change its behaviour. Obviously this is not a hard rule, there

[issue35549] Add partial_match: bool = False argument to unicodedata.lookup

2018-12-21 Thread Roman Inflianskas
New submission from Roman Inflianskas : I propose to add partial_match: bool = False argument to unicodedata.lookup so that the programmer could search Unicode symbols using partial_names. -- components: Unicode messages: 332283 nosy: ezio.melotti, rominf, vstinner priority: normal sev