GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add block info to unicodedata · Issue #66802 · python/cpython

Add block info to unicodedata #66802

New issue
Copy link
New issue
Copy link
Closed
Closed
Add block info to unicodedata#66802
Copy link
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-unicodetype-featureA feature request or enhancementA feature request or enhancement

Description

flying-sheep
mannequin
opened on Oct 11, 2014
Issue body actions
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

  • gh-66802: Add unicodedata.block() function #145042

Activity

  1. flying-sheep commented on Oct 11, 2014

    @flying-sheep
    flying-sheepmannequin
    on Oct 11, 2014
    MannequinAuthor
    More actions

    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. flying-sheep
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Oct 11, 2014
  3. ezio-melotti commented on Nov 2, 2014

    @ezio-melotti
    ezio-melotti
    on Nov 2, 2014
    Member
    More actions

    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.

  4. ezio-melotti
    added
    topic-unicode
    on Nov 2, 2014
  5. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  6. StanFromIreland
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on Feb 20, 2026
  7. malemburg
    closed this as completedin f1f61bfon Feb 21, 2026
  8. pull
    added a commit that references this issue on Feb 21, 2026

    pythongh-66802: Add `unicodedata.block()` function (python#145042)

    f1f61bf
  9. brijkapadia
    added a commit that references this issue on Feb 28, 2026

    pythongh-66802: Add `unicodedata.block()` function (python#145042)

    7938d2f
  10. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-66802: Add `unicodedata.block()` function (python#145042)

    c302174
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirC modules in the Modules dirtopic-unicodetype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.