Skip to main content

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

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.0.0.tar.gz (6.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for namedspace-1.0.0.tar.gz
Algorithm Hash digest
SHA256 69f24f703e3b5089feed94bda663ef77c2f92db96ecebf458c09388040fcc03e
MD5 cb986aa861b58778ea7c2ae4ece4bf53
BLAKE2b-256 a0cef5e8988bbd2e86f338601fb619fa9d47b6c840c7ea36badda9b43feb6979

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.1

1 file

1.2.0

1 file

1.1.1

1 file

1.1.0

1 file

1.0.1

1 file

This release

1.0.0 This release

1 file

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