Skip to main content

Notes

Changelog

  • 2011-01-29 adrian ilarion ciobanu <cia@mud.ro>
    • initial release 0.1.1

    • pypi-related fixups

    • minor bugfixing, documentation updates, package restructuring 0.1.18

  • 2011-01-30 adrian ilarion ciobanu <cia@mud.ro>
    • improved weaktuple’s __iter__() method

    • 0.1.19 release

Description

subtypes are python types with new or removed constraints/properties.

currently, the package includes the following subtypes:

subtypes.weaktuple

the weaktuple is a tuple with weakened immutability.

the main difference between the two is that the weaktuple’s immutability is only concerned with the size and the underlying type of each component.

in other words, tuple’s immutability property can be viewed as a set of three constraints C = (tupleSize, tupleComponentValue, tupleComponentType) (the third may be somehow implicit). The weaktuple’s set of constraints has only two components: C = (tupleSize,tupleComponentType), equivalent to “tuple has a product type” if you like.

the values of weaktuple’s component can be updated as long as the component’s type and tuple’s size constraints are verified.

applicability: storing the arguments to a function as a tuple for a later function call: while computing a set of conditions, the arguments may be needing updates. It’s easier, clearer and hopefully faster to do an inplace tuple member update:

>>> from subtypes.weaktuple import weaktuple
>>> def f(p1,p2,p3):
...     print "called with:(%r,%r,%r)"%(p1,p2,p3)
...
>>> o=weaktuple([1,'abc',[(1,2),(1,3),(2,3)]])
>>> o
(1, 'abc', [(1, 2), (1, 3),(2, 3)])
>>> f(*o)
called with:(1,'abc',[(1, 2),(1, 3), (2, 3)])
>>> if issubclass(weaktuple,tuple): o[1]='cba'
>>> f(*o)
called with:(1,'cba',[(1,2), (1,3), (2,3)])
>>>

see weaktuple module documentation for additional information

coming up:
  • weakbool

Metadata

Release files for subtypes 0.1.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subtypes 0.1.19
File Size Uploaded Provenance
subtypes-0.1.19.tar.gz 5.0 kB Without provenance Details

Release files / subtypes-0.1.19.tar.gz

Download URL subtypes-0.1.19.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
aab2afbe7a53692d5b3e67836f621bb7a3a04d415fbafe6e0fc052782622efe7
BLAKE2b-256 checksum
How to use checksums
906814102fa462c0f30c12e9be8e88c8ac4d35d8d4162fe570f141a4b0c37cb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for subtypes 0.1.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page