Skip to main content

Intensional sets in Python

Project description

Intensional (rule-defined) sets for Python.

Overview

There are two ways of defining a set: intensional and extensional. Extensional sets like set([1,3,5,'daisy']) enumerate every member of the set explicitly.

Intensional sets, in contrast, are defined by rules. For example “the set of all prime numbers” or “every word beginning with 'a' and ending with 't'. Intensional sets are often infinite. It may be possible to generate a list of their members, but it’s not as simple as a “give me everything you’ve got!” for loop.

Once you know what you’re looking for, intensional sets are everywhere. Python doesn’t represent them directly, but regular expressions, many list comprehensions, and all manner of testing and filtering operations are really faces of the intensional set concept. Many functions test whether something ‘qualifies’. os.path.isdir(d) for example, tests whether d is in the set of legitimate directories, and isinstance(s, str) tests whether s is a member of the set of str objects. Even the core if conditional can be construed as testing for membership in an intensional set–the set of all items that pass the test.

Many such tests have a temporal aspect–they determine whether a value is a member right now. The answer may change in the future, if conditions change. Others tests are invariant over time. %%734 will never be a valid Python identifier, no matter how many times it’s tested–unless the rules of the overall Python universe change, that is.

Intensional sets are part and parcel of all programming, even if they’re not explicitly represented or called by that name.``intensional`` helps Python programs represent intensional sets directly.

NB Active construciton zone.

Installation

pip install intensional

(You may need to prefix this with “sudo “ to authorize installation.)

Project details


Download files

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

Source Distributions

intensional-0.106.zip (10.6 kB view details)

Uploaded Source

intensional-0.106.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file intensional-0.106.zip.

File metadata

  • Download URL: intensional-0.106.zip
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for intensional-0.106.zip
Algorithm Hash digest
SHA256 6853cc6fceb587c9c030db67b688a8f3a7fc9f8e7d25d105947ec46943bc9715
MD5 1e16b5c4a8a715956b4276c651aab3b6
BLAKE2b-256 60182cd8fa12134080a89935a61b35f6a95939595c93a58d45b1788301669d1c

See more details on using hashes here.

File details

Details for the file intensional-0.106.tar.gz.

File metadata

  • Download URL: intensional-0.106.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for intensional-0.106.tar.gz
Algorithm Hash digest
SHA256 df225a823316048bd3d14ddccdf2dd563e894b55ccdc2e70f69aa66ed15f8ce2
MD5 a67fbb4a291131a185e6daa1aaffa379
BLAKE2b-256 9193182593cae9225585996c671b5c0a66b61da5155b98d2d11f7b5767d65325

See more details on using hashes here.

Supported by

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