Named Tuples 1.9

Named Tuples 1.9 Download Summary

  • Language: Python
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • License: Other Free / Open Source License - Python License
  • Databases: N/A
  • Downloads: 542
  • Released: Jun 7, 2007

Named Tuples 1.9 Description

This script allows you a fast, lightweight attribute-style access to tuples. It contains a function that returns a new subclass of tuple with named fields.

The principal features are:
- Easy to type/read/modify function signature: NamedTuple('Person', 'name age sex height nationality') 
- C-speed attribute lookup using property and itemgetter.
- No instance dictionary means that instances take no more space than a regular tuple. 
- Nice docstring is helpful with an editor's tooltips. 
- Optional keywords in the contructor for readability and to allow variable order of specifying arguments: Person(name='susan', height=60, nationality='english', sex='f', age=30). 
- Key/Value style repr for clearer error messages and for usability at the interactive prompt. 
- Named tuples are picklable.
- Clean error messages for missing or misnamed arguments. 
- A method similar to str.replace() using a field name (used instead of slicing for updating fields -- instead of t[:2] newval t[3:], write t.replace('f',newval)).

Named Tuples Bookmark

Hyperlink code:
Hyperlink for Forum code:

Named Tuples 1.9 Script Download Notice

Top 4 Download periodically updates information of Named Tuples 1.9 script from the developer, but some information may be slightly out-of-date.

Our script download links are directly from our mirrors or publisher's website. Named Tuples 1.9 torrent files or shared files from free file sharing and free upload services, including Rapidshare, MegaUpload, YouSendIt, MailBigFile, DropSend, HellShare, HotFile, FileServe, MediaMax, zUpload, MyOtherDrive, SendSpace, DepositFiles, Letitbit, LeapFile, DivShare or MediaFire, are not allowed!

Tuples with Named Elements via Spawning

Instead of requiring the named attributes list for each instantiation of the tuple, this ... derived tuple class that is taylored to the named attributes specified. And it is this Spawned class that is then used to instantiate tuples. This approach effectively separates the definition of the attribute names from the ...
Python

TryFinally

This script is a convenient way to deeply nest try/finally statements. It is appropriate for complicated resource initialization and destruction. For instance, if you have a list of 50 things that need to get intialized and later destructed via using try/finally (especially if you need to create the list dynamically) this function ...
Python

Simpler item retrieval using tupled subscripting

... items. By allowing for the subscripting to use tuples some very annoying cases becomes much simpler. This script is suitable for large data sets where you need alot of very specific items, but it becomes very annoying to type each subscript seperatly and add the lists up. It is also much clearer ...
Python

IPv4 address set type

... unlimited number of arguments that may either be tuples in the form (start,stop), integers, longs or strings, where start and stop in a tuple may also be of the form integer, long or string. Passing an integer or long means passing an IPv4-address that's already been converted to integer notation, ...
Python

Public and protected attribute access

... script presents a way to introduce proper attribute access protection levels using a generic proxy object. By default all attributes are "protected" in the C sense and can be declared as public using either a function decorator or a class attribute. ...
Python