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
>>> 'b' in s

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

Release history Release notifications

Download files

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

Files for unicodeset, version 0.1.0
Filename, size & hash File type Python version Upload date
unicodeset-0.1.0.tar.gz (1.7 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page