Skip to main content

set superclass for unicode character sets

Project description

unicodeset is a small module for managing sets of unique unicode code points.

The classes UnicodeSet and FrozenUnicodeSet as superclasses of the respective Python builtins.

from unicodeset import UnicodeSet, FrozenUnicodeSet

Values can be passed in as either integers or strings (or unicode strings in Python 2.7).

>>> s = UnicodeSet(['a', 98, u'c'])
UnicodeSet([u'a', u'b', u'c'])

Inclusion can be checked using either an integer or string representations.

>>> s = UnicodeSet([u'a', u'b', u'c'])
>>> 98 in s
True
>>> 'b' in s
True

Iterating over UnicodeSet returns values sorted by code point.

>>> [c for c in UnicodeSet(['z', 'n', '$', 'a'])]
[u'$', u'a', u'n', u'z']

Supports Python 2.6 – 3.x

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unicodeset-0.1.0.tar.gz (1.7 kB view details)

Uploaded Source

File details

Details for the file unicodeset-0.1.0.tar.gz.

File metadata

  • Download URL: unicodeset-0.1.0.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for unicodeset-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2c4d0f23589a21edee11a2149848ecbbc5e9dfd42a4c7244092bae0f126e62b8
MD5 d76119e5b9f8397245373694e766ec5e
BLAKE2b-256 91a6f0be9eb44cf20141fb01b5028ce4dcc93431b5f1b1ca50c6065fed7b8c9f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page