Skip to main content

Namespace class factory.

Project description

The namedspace factory generates a simple class that encapsulates a namespace and provides various means to access it.

It is inspired by namedtuple (and shamelessly copies some of the namedtuple code), and was motivated by my realization that I was often abusing namedtuple, using a namedtuple as a base class for numerous simple custom classes that I was writing.

In these cases, it was the named attribute access and immutability of the namedtuple that was desirable, and the sequence behavior was not needed. In fact, when properties were used to override the returned value of a named attribute, the values available from the underlying tuple would not match. Fixing this behavior in a sub-class proved much more difficult than expected, which was especially frustrating since this was behavior that wasn’t needed anyway.

So, namedspace was born. Orginally, I called it “namespace” (without the ‘d’), but there was already a namespace project on PyPi, and calling it “namedspace” gives a nod to its namedtuple ancestry.

Enjoy!

–Warren A. Smith

Read the docs: http://namedspace.readthedocs.org/

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

namedspace-1.2.1.tar.gz (83.0 kB view details)

Uploaded Source

File details

Details for the file namedspace-1.2.1.tar.gz.

File metadata

  • Download URL: namedspace-1.2.1.tar.gz
  • Upload date:
  • Size: 83.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for namedspace-1.2.1.tar.gz
Algorithm Hash digest
SHA256 0a4f3c46786fd77bcb448aab7488cde8e64e5047bf6b9064e2081da5bff6b1f8
MD5 5697ef61690e178a45de5813219de4a4
BLAKE2b-256 436369f3eefd92488c354e7d143ab9d58da08bd49a8a4941f64738b958733e58

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