FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add block info to unicodedata · Issue #66802 · python/cpython · GitHub

Repository navigation

Add block info to unicodedata #66802

Closed
Closed

Description

BPO 22612
Nosy @vstinner, @ezio-melotti, @flying-sheep

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2014-10-11.17:58:45.231>
labels = ['type-feature', 'expert-unicode']
title = 'Add block info to unicodedata'
updated_at = <Date 2015-10-17.07:47:47.945>
user = 'https://github.com/flying-sheep'

bugs.python.org fields:

activity = <Date 2015-10-17.07:47:47.945>
actor = 'Denis Jacquerye'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Unicode']
creation = <Date 2014-10-11.17:58:45.231>
creator = 'flying sheep'
dependencies = []
files = []
hgrepos = []
issue_num = 22612
keywords = []
message_count = 2.0
messages = ['229101', '230498']
nosy_count = 4.0
nosy_names = ['vstinner', 'ezio.melotti', 'flying sheep', 'Denis Jacquerye']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue22612'
versions = ['Python 3.5']

Linked PRs

Activity

  1. flying-sheep commented on Oct 11, 2014

    flying-sheepmannequin
    MannequinAuthor

    See also bpo-6331.

    The repo https://github.com/nagisa/unicodeblocks contains pretty much the functionality i’d like to see: a way to get access to information about all blocks, and a way to get the block name a char is in.

    I propose to include something very similar to those two APIs in unicodedata:

    unicodedata.Block: class with start, end, and name property.

    its __contains__ should work for single-char-strings (which tests if that char is in the block) and for ints (which tests if the codepoint is in the block)

    maybe make it iterable over its chars?

    unicodedata.blocks: OrderedDict of str (block name) → Block object mappings ordered by Block.start.

    then blocks.keys() would yield the names in order, and blocks.values() the block objects in order.

    unicodedata.block_of(chr, name_only=False): returns the Block object for which “chr in block” is True, or its name.

    ---

    alternative: make the Block class an unfancy namedtuple without __contains__ method.

    ---

    Together with bpo-18234, fixing this bug will complete UnicodeData support in python, i guess.

  2. ezio-melotti commented on Nov 2, 2014

    Member

    I needed this in the past and had to implement it myself, so adding it to unicodedata might be OK. A script to generate the list of blocks from the official Unicode files should probably be created and used whenever we update the version of the Unicode database.

  3. transferred this issue fromon Apr 10, 2022
  4. added a commit that references this issue on Feb 21, 2026
  5. added a commit that references this issue on Feb 28, 2026
  6. added a commit that references this issue on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL