===========
namedlist
===========
WARNING
=======
This package is no longer maintained, except for exceptional cases.
Please use the built-in dataclasses module instead.
Overview
========
namedlist provides 2 factory functions, namedlist.namedlist and
namedlist.namedtuple. namedlist.namedtuple is similar to
collections.namedtuple, with the following differences:
* namedlist.namedtuple supports per-field default values.
* namedlist.namedtuple supports an optional default value, to be used
by all fields that do not have an explicit default value.
namedlist.namedlist is similar, with this additional difference:
* namedlist.namedlist instances are mutable.
Typical usage
=============
You can use namedlist like a mutable namedtuple::
>>> from namedlist import namedlist
>>> Point = namedlist('Point', 'x y')
>>> p = Point(1, 3)
>>> p.x = 2
>>> assert p.x == 2
>>> assert p.y == 3
Or, you can specify a default value for all fields::
>>> Point = namedlist('Point', 'x y', default=3)
>>> p = Point(y=2)
>>> assert p.x == 3
>>> assert p.y == 2
Or, you can specify per-field default values::
>>> Point = namedlist('Point', [('x', 0), ('y', 100)])
>>> p = Point()
>>> assert p.x == 0
>>> assert p.y == 100
You can also specify the per-field defaults with a mapping, instead
of an iterable. Note that this is only useful with an ordered
mapping, such as an OrderedDict::
>>> from collections import OrderedDict
>>> Point = namedlist('Point', OrderedDict((('y', 0),
... ('x', 100))))
>>> p = Point()
>>> p
Point(y=0, x=100)
The default value will only be used if it is provided and a per-field
default is not used::
>>> Point = namedlist('Point', ['x', ('y', 100)], default=10)
>>> p = Point()
>>> assert p.x == 10
>>> assert p.y == 100
If you use a mapping, the value NO_DEFAULT is convenient to specify
that a field uses the default value::
>>> from namedlist import NO_DEFAULT
>>> Point = namedlist('Point', OrderedDict((('y', NO_DEFAULT),
... ('x', 100))),
... default=5)
>>> p = Point()
>>> assert p.x == 100
>>> assert p.y == 5
namedtuple is similar, except the instances are immutable::
>>> from namedlist import namedtuple
>>> Point = namedtuple('Point', 'x y', default=3)
>>> p = Point(y=2)
>>> assert p.x == 3
>>> assert p.y == 2
>>> p.x = 10
Traceback (most recent call last):
...
AttributeError: can't set attribute
All of the documentation below in the Specifying Fields and Specifying
Defaults sections applies to namedlist.namedlist and
namedlist.namedtuple.
Creating types
==============
Specifying Fields
-----------------
Fields in namedlist.namedlist or namedlist.namedtuple can be specified
as in collections.namedtuple: as either a string specifing the field
names, or as a iterable of field names. These two uses are
equivalent::
>>> Point = namedlist('Point', 'x y')
>>> Point = namedlist('Point', ['x', 'y'])
As are these::
>>> Point = namedtuple('Point', 'x y')
>>> Point = namedtuple('Point', ['x', 'y'])
If using a string, commas are first converted to spaces. So these are
equivalent::
>>> Point = namedlist('Point', 'x y')
>>> Point = namedlist('Point', 'x,y')
Specifying Defaults
-------------------
Per-field defaults can be specified by supplying a 2-tuple (name,
default_value) instead of just a string for the field name. This is
only supported when you specify a list of field names::
>>> Point = namedlist('Point', [('x', 0), ('y', 0)])
>>> p = Point(3)
>>> assert p.x == 3
>>> assert p.y == 0
Or, using namedtuple::
>>> Point = namedtuple('Point', [('x', 0), ('y', 0)])
>>> p = Point(3)
>>> assert p.x == 3
>>> assert p.y == 0
In addition to, or instead of, these per-field defaults, you can also
specify a default value which is used when no per-field default value
is specified::
>>> Point = namedlist('Point', 'x y z', default=0)
>>> p = Point(y=3)
>>> assert p.x == 0
>>> assert p.y == 3
>>> assert p.z == 0
>>> Point = namedlist('Point', [('x', 0), 'y', ('z', 0)], default=4)
>>> p = Point(z=2)
>>> assert p.x == 0
>>> assert p.y == 4
>>> assert p.z == 2
In addition to supplying the field names as an iterable of 2-tuples,
you can also specify a mapping. The keys will be the field names, and
the values will be the per-field default values. This is most useful
with an OrderedDict, as the order of the fields will then be
deterministic. The module variable NO_DEFAULT can be specified if you
want a field to use the per-type default value instead of specifying
it with a field::
>>> Point = namedlist('Point', OrderedDict((('x', 0),
... ('y', NO_DEFAULT),
... ('z', 0),
... )),
... default=4)
>>> p = Point(z=2)
>>> assert p.x == 0
>>> assert p.y == 4
>>> assert p.z == 2
Writing to values
-----------------
Instances of the classes generated by namedlist.namedlist are fully
writable, unlike the tuple-derived classes returned by
collections.namedtuple or namedlist.namedtuple::
>>> Point = namedlist('Point', 'x y')
>>> p = Point(1, 2)
>>> p.y = 4
>>> assert p.x == 1
>>> assert p.y == 4
Specifying __slots__
--------------------
For namedlist.namedlist, by default, the returned class sets __slots__
which is initialized to the field names. While this decreases memory
usage by eliminating the instance dict, it also means that you cannot
create new instance members.
To change this behavior, specify use_slots=False when creating the
namedlist::
>>> Point = namedlist('Point', 'x y', use_slots=False)
>>> p = Point(0, 1)
>>> p.z = 2
>>> assert p.x == 0
>>> assert p.y == 1
>>> assert p.z == 2
However, note that this method does not add the new variable to
_fields, so it is not recognized when iterating over the instance::
>>> list(p)
[0, 1]
>>> sorted(p._asdict().items())
[('x', 0), ('y', 1)]
Additional class members
------------------------
namedlist.namedlist and namedlist.namedtuple classes contain these members:
* _asdict(): Returns a dict which maps field names to their
corresponding values.
* _fields: Tuple of strings listing the field names. Useful for introspection.
Renaming invalid field names
----------------------------
This functionality is identical to collections.namedtuple. If you
specify rename=True, then any invalid field names are changed to _0,
_1, etc. Reasons for a field name to be invalid are:
* Zero length strings.
* Containing characters other than alphanumerics and underscores.
* A conflict with a Python reserved identifier.
* Beginning with a digit.
* Beginning with an underscore.
* Using the same field name more than once.
For example::
>>> Point = namedlist('Point', 'x x for', rename=True)
>>> assert Point._fields == ('x', '_1', '_2')
Mutable default values
----------------------
For namedlist.namelist, be aware of specifying mutable default
values. Due to the way Python handles default values, each instance of
a namedlist will share the default. This is especially problematic
with default values that are lists. For example::
>>> A = namedlist('A', [('x', [])])
>>> a = A()
>>> a.x.append(4)
>>> b = A()
>>> assert b.x == [4]
This is probably not the desired behavior, so see the next section.
Specifying a factory function for default values
------------------------------------------------
For namedlist.namedlist, you can supply a zero-argument callable for a
default, by wrapping it in a FACTORY call. The only change in this
example is to change the default from `[]` to `FACTORY(list)`. But
note that `b.x` is a new list object, not shared with `a.x`::
>>> from namedlist import FACTORY
>>> A = namedlist('A', [('x', FACTORY(list))])
>>> a = A()
>>> a.x.append(4)
>>> b = A()
>>> assert b.x == []
Every time a new instance is created, your callable (in this case,
`list`), will be called to produce a new instance for the default
value.
Iterating over instances
------------------------
Because instances are iterable (like lists or tuples), iteration works
the same way. Values are returned in definition order::
>>> Point = namedlist('Point', 'x y z t')
>>> p = Point(1.0, 42.0, 3.14, 2.71828)
>>> for value in p:
... print(value)
1.0
42.0
3.14
2.71828
namedlist specific functions
============================
_update
-------
`namedlist._update()` is similar to `dict.update()`. It is used to
mutate a namedlist.namedlist instance with new values::
>>> Point = namedlist('Point', 'x y z')
>>> p = Point(1, 2, 3)
>>> p.z = 4
>>> p._update(y=5, x=6)
>>> p
Point(x=6, y=5, z=4)
>>> p._update({'x': 7, 'z': 8})
>>> p
Point(x=7, y=5, z=8)
>>> p._update([('z', 9), ('y', 10)])
>>> p
Point(x=7, y=10, z=9)
Creating and using instances
============================
Because the type returned by namedlist or namedtuple is a normal
Python class, you create instances as you would with any Python class.
Bitbucket vs. GitLab
====================
The repository used to be on Bitbucket in Mercurial format. But
Bitbucket dropped Mercurial support and did not provide any way to
migrate issues to a git repository, even one hosted on Bitbucket. So,
I abandoned Bitbucket and moved the code to GitLab. Thus, all of the
issue were lost, and new issues started again with #1. I'm naming the
GitLab issues as #GH-xx, and the old Bitbucket issues as #BB-xx. I'm
still angry at Bitbucket for forcing this change.
Change log
==========
1.8 2020-08-29 Eric V. Smith
----------------------------
* Add python 3.8 compatibility (#GL-1).
* Moved to gitlab.
* Require setuptools, and specify universal wheels (issue #BB-30).
* Drop code for bdist_rpm that tried to change the RPM name to
python-namedlist (issue #BB-31).
1.7 2015-05-15 Eric V. Smith
----------------------------
* Changed RPM name to python3-namedlist if running with python 3.
* No code changes.
1.6 2014-12-23 Eric V. Smith
----------------------------
* Add namedlist._update(), similar to dict.update(). Thanks to Arthur
Skowronek (issue #BB-23).
* Add namedlist._replace(), similar to namedtuple._replace (issue
#BB-24).
1.5 2014-05-20 Eric V. Smith
----------------------------
* Support slices in namedlist.__getattr__ (issue #BB-22).
1.4 2014-03-14 Eric V. Smith
----------------------------
* Add MANIFEST.in to MANIFEST.in, so it will be included in sdists
(issue #BB-21).
1.3 2014-03-12 Eric V. Smith
----------------------------
* Support unicode type and field names in Python 2.x (issue #BB-19). The
identifiers still must be ASCII only, but you can pass them as
unicode. This is useful for code that needs to run under both Python
2 and Python 3.
1.2 2014-02-13 Eric V. Smith
----------------------------
* Produce an RPM named python-namedlist (issue #BB-17).
* Add namedtuple (issue #BB-10). Passes all of the collections.namedtuple
tests, except those related to _source. Those tests don't apply
given our different approach to dynamic class creation. All other
collections.namedtuple tests have been copied to our test suite.
1.1 2014-02-07 Eric V. Smith
----------------------------
* Added __dict__ so vars() will be supported.
* Fixed pickling from another module (issue #BB-14).
* Moved tests to a separate file (issue #BB-15).
1.0 2014-02-04 Eric V. Smith
----------------------------
* Declare the API stable and release version 1.0.
* Support python 2.6 (issue #BB-8). The doctests don't pass because
OrderedDict isn't available until 2.7.
0.4 2014-02-04 Eric V. Smith
----------------------------
* Add docstring (issue #BB-7).
* Fixed README.txt typos (thanks pombredanne on bitbucket).
0.3 2014-01-29 Eric V. Smith
----------------------------
* Removed documentation left over from recordtype.
* Make instances unhashable (issue #BB-2).
* For python3, use str.isidentifier (issue #BB-1).
* Reorganize code for name checking. No functional changes.
* Make instances iterable (issue #BB-3).
* Add collections.Sequence ABC (issue #BB-4).
* Have "python setup.py test" also run doctests (issue #BB-5).
0.2 2014-01-28 Eric V. Smith
----------------------------
* Added MANIFEST.in.
* Hopefully fixed a problem with .rst formatting in CHANGES.txt.
0.1 2014-01-28 Eric V. Smith
----------------------------
* Initial release.
* Based off my recordtype project, but uses ast generation instead of
building up a string and exec-ing it. This has a number of advantages:
- Supporting both python2 and python3 is easier. exec has the
anti-feature of having different syntax in the two languages.
- Adding additional features is easier, because I can write in real
Python instead of having to write the string version, and deal
with all of the escaping and syntax errors.
* Added FACTORY, to allow namedlist to work even with mutable defaults.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/ericvsmith/namedlist",
"name": "namedlist",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Eric V. Smith",
"author_email": "eric@trueblade.com",
"download_url": "https://files.pythonhosted.org/packages/4b/9e/e4f507ac072cfb7bb3b31deea8f2f25c21f44a2e3deb223e0f0202c297c0/namedlist-1.8.tar.gz",
"platform": "",
"description": "===========\nnamedlist\n===========\n\nWARNING\n=======\n\nThis package is no longer maintained, except for exceptional cases.\nPlease use the built-in dataclasses module instead.\n\nOverview\n========\n\nnamedlist provides 2 factory functions, namedlist.namedlist and\nnamedlist.namedtuple. namedlist.namedtuple is similar to\ncollections.namedtuple, with the following differences:\n\n* namedlist.namedtuple supports per-field default values.\n\n* namedlist.namedtuple supports an optional default value, to be used\n by all fields that do not have an explicit default value.\n\n\nnamedlist.namedlist is similar, with this additional difference:\n\n* namedlist.namedlist instances are mutable.\n\nTypical usage\n=============\n\nYou can use namedlist like a mutable namedtuple::\n\n >>> from namedlist import namedlist\n\n >>> Point = namedlist('Point', 'x y')\n >>> p = Point(1, 3)\n >>> p.x = 2\n >>> assert p.x == 2\n >>> assert p.y == 3\n\nOr, you can specify a default value for all fields::\n\n >>> Point = namedlist('Point', 'x y', default=3)\n >>> p = Point(y=2)\n >>> assert p.x == 3\n >>> assert p.y == 2\n\nOr, you can specify per-field default values::\n\n >>> Point = namedlist('Point', [('x', 0), ('y', 100)])\n >>> p = Point()\n >>> assert p.x == 0\n >>> assert p.y == 100\n\nYou can also specify the per-field defaults with a mapping, instead\nof an iterable. Note that this is only useful with an ordered\nmapping, such as an OrderedDict::\n\n >>> from collections import OrderedDict\n >>> Point = namedlist('Point', OrderedDict((('y', 0),\n ... ('x', 100))))\n >>> p = Point()\n >>> p\n Point(y=0, x=100)\n\nThe default value will only be used if it is provided and a per-field\ndefault is not used::\n\n >>> Point = namedlist('Point', ['x', ('y', 100)], default=10)\n >>> p = Point()\n >>> assert p.x == 10\n >>> assert p.y == 100\n\nIf you use a mapping, the value NO_DEFAULT is convenient to specify\nthat a field uses the default value::\n\n >>> from namedlist import NO_DEFAULT\n >>> Point = namedlist('Point', OrderedDict((('y', NO_DEFAULT),\n ... ('x', 100))),\n ... default=5)\n >>> p = Point()\n >>> assert p.x == 100\n >>> assert p.y == 5\n\nnamedtuple is similar, except the instances are immutable::\n\n >>> from namedlist import namedtuple\n >>> Point = namedtuple('Point', 'x y', default=3)\n >>> p = Point(y=2)\n >>> assert p.x == 3\n >>> assert p.y == 2\n >>> p.x = 10\n Traceback (most recent call last):\n ...\n AttributeError: can't set attribute\n\nAll of the documentation below in the Specifying Fields and Specifying\nDefaults sections applies to namedlist.namedlist and\nnamedlist.namedtuple.\n\nCreating types\n==============\n\nSpecifying Fields\n-----------------\n\nFields in namedlist.namedlist or namedlist.namedtuple can be specified\nas in collections.namedtuple: as either a string specifing the field\nnames, or as a iterable of field names. These two uses are\nequivalent::\n\n >>> Point = namedlist('Point', 'x y')\n >>> Point = namedlist('Point', ['x', 'y'])\n\nAs are these::\n\n >>> Point = namedtuple('Point', 'x y')\n >>> Point = namedtuple('Point', ['x', 'y'])\n\nIf using a string, commas are first converted to spaces. So these are\nequivalent::\n\n >>> Point = namedlist('Point', 'x y')\n >>> Point = namedlist('Point', 'x,y')\n\n\nSpecifying Defaults\n-------------------\n\nPer-field defaults can be specified by supplying a 2-tuple (name,\ndefault_value) instead of just a string for the field name. This is\nonly supported when you specify a list of field names::\n\n >>> Point = namedlist('Point', [('x', 0), ('y', 0)])\n >>> p = Point(3)\n >>> assert p.x == 3\n >>> assert p.y == 0\n\nOr, using namedtuple::\n\n >>> Point = namedtuple('Point', [('x', 0), ('y', 0)])\n >>> p = Point(3)\n >>> assert p.x == 3\n >>> assert p.y == 0\n\n\nIn addition to, or instead of, these per-field defaults, you can also\nspecify a default value which is used when no per-field default value\nis specified::\n\n >>> Point = namedlist('Point', 'x y z', default=0)\n >>> p = Point(y=3)\n >>> assert p.x == 0\n >>> assert p.y == 3\n >>> assert p.z == 0\n\n >>> Point = namedlist('Point', [('x', 0), 'y', ('z', 0)], default=4)\n >>> p = Point(z=2)\n >>> assert p.x == 0\n >>> assert p.y == 4\n >>> assert p.z == 2\n\nIn addition to supplying the field names as an iterable of 2-tuples,\nyou can also specify a mapping. The keys will be the field names, and\nthe values will be the per-field default values. This is most useful\nwith an OrderedDict, as the order of the fields will then be\ndeterministic. The module variable NO_DEFAULT can be specified if you\nwant a field to use the per-type default value instead of specifying\nit with a field::\n\n >>> Point = namedlist('Point', OrderedDict((('x', 0),\n ... ('y', NO_DEFAULT),\n ... ('z', 0),\n ... )),\n ... default=4)\n >>> p = Point(z=2)\n >>> assert p.x == 0\n >>> assert p.y == 4\n >>> assert p.z == 2\n\nWriting to values\n-----------------\n\nInstances of the classes generated by namedlist.namedlist are fully\nwritable, unlike the tuple-derived classes returned by\ncollections.namedtuple or namedlist.namedtuple::\n\n >>> Point = namedlist('Point', 'x y')\n >>> p = Point(1, 2)\n >>> p.y = 4\n >>> assert p.x == 1\n >>> assert p.y == 4\n\n\nSpecifying __slots__\n--------------------\n\nFor namedlist.namedlist, by default, the returned class sets __slots__\nwhich is initialized to the field names. While this decreases memory\nusage by eliminating the instance dict, it also means that you cannot\ncreate new instance members.\n\nTo change this behavior, specify use_slots=False when creating the\nnamedlist::\n\n >>> Point = namedlist('Point', 'x y', use_slots=False)\n >>> p = Point(0, 1)\n >>> p.z = 2\n >>> assert p.x == 0\n >>> assert p.y == 1\n >>> assert p.z == 2\n\nHowever, note that this method does not add the new variable to\n_fields, so it is not recognized when iterating over the instance::\n\n >>> list(p)\n [0, 1]\n >>> sorted(p._asdict().items())\n [('x', 0), ('y', 1)]\n\n\nAdditional class members\n------------------------\n\nnamedlist.namedlist and namedlist.namedtuple classes contain these members:\n\n* _asdict(): Returns a dict which maps field names to their\n corresponding values.\n\n* _fields: Tuple of strings listing the field names. Useful for introspection.\n\n\nRenaming invalid field names\n----------------------------\n\nThis functionality is identical to collections.namedtuple. If you\nspecify rename=True, then any invalid field names are changed to _0,\n_1, etc. Reasons for a field name to be invalid are:\n\n* Zero length strings.\n\n* Containing characters other than alphanumerics and underscores.\n\n* A conflict with a Python reserved identifier.\n\n* Beginning with a digit.\n\n* Beginning with an underscore.\n\n* Using the same field name more than once.\n\nFor example::\n\n >>> Point = namedlist('Point', 'x x for', rename=True)\n >>> assert Point._fields == ('x', '_1', '_2')\n\n\nMutable default values\n----------------------\n\nFor namedlist.namelist, be aware of specifying mutable default\nvalues. Due to the way Python handles default values, each instance of\na namedlist will share the default. This is especially problematic\nwith default values that are lists. For example::\n\n >>> A = namedlist('A', [('x', [])])\n >>> a = A()\n >>> a.x.append(4)\n >>> b = A()\n >>> assert b.x == [4]\n\nThis is probably not the desired behavior, so see the next section.\n\n\nSpecifying a factory function for default values\n------------------------------------------------\n\nFor namedlist.namedlist, you can supply a zero-argument callable for a\ndefault, by wrapping it in a FACTORY call. The only change in this\nexample is to change the default from `[]` to `FACTORY(list)`. But\nnote that `b.x` is a new list object, not shared with `a.x`::\n\n >>> from namedlist import FACTORY\n >>> A = namedlist('A', [('x', FACTORY(list))])\n >>> a = A()\n >>> a.x.append(4)\n >>> b = A()\n >>> assert b.x == []\n\nEvery time a new instance is created, your callable (in this case,\n`list`), will be called to produce a new instance for the default\nvalue.\n\nIterating over instances\n------------------------\n\nBecause instances are iterable (like lists or tuples), iteration works\nthe same way. Values are returned in definition order::\n\n >>> Point = namedlist('Point', 'x y z t')\n >>> p = Point(1.0, 42.0, 3.14, 2.71828)\n >>> for value in p:\n ... print(value)\n 1.0\n 42.0\n 3.14\n 2.71828\n\n\nnamedlist specific functions\n============================\n\n_update\n-------\n\n`namedlist._update()` is similar to `dict.update()`. It is used to\nmutate a namedlist.namedlist instance with new values::\n\n >>> Point = namedlist('Point', 'x y z')\n >>> p = Point(1, 2, 3)\n >>> p.z = 4\n >>> p._update(y=5, x=6)\n >>> p\n Point(x=6, y=5, z=4)\n\n >>> p._update({'x': 7, 'z': 8})\n >>> p\n Point(x=7, y=5, z=8)\n\n >>> p._update([('z', 9), ('y', 10)])\n >>> p\n Point(x=7, y=10, z=9)\n\n\nCreating and using instances\n============================\n\nBecause the type returned by namedlist or namedtuple is a normal\nPython class, you create instances as you would with any Python class.\n\nBitbucket vs. GitLab\n====================\n\nThe repository used to be on Bitbucket in Mercurial format. But\nBitbucket dropped Mercurial support and did not provide any way to\nmigrate issues to a git repository, even one hosted on Bitbucket. So,\nI abandoned Bitbucket and moved the code to GitLab. Thus, all of the\nissue were lost, and new issues started again with #1. I'm naming the\nGitLab issues as #GH-xx, and the old Bitbucket issues as #BB-xx. I'm\nstill angry at Bitbucket for forcing this change.\n\nChange log\n==========\n\n1.8 2020-08-29 Eric V. Smith\n----------------------------\n\n* Add python 3.8 compatibility (#GL-1).\n\n* Moved to gitlab.\n\n* Require setuptools, and specify universal wheels (issue #BB-30).\n\n* Drop code for bdist_rpm that tried to change the RPM name to\n python-namedlist (issue #BB-31).\n\n1.7 2015-05-15 Eric V. Smith\n----------------------------\n\n* Changed RPM name to python3-namedlist if running with python 3.\n\n* No code changes.\n\n1.6 2014-12-23 Eric V. Smith\n----------------------------\n\n* Add namedlist._update(), similar to dict.update(). Thanks to Arthur\n Skowronek (issue #BB-23).\n\n* Add namedlist._replace(), similar to namedtuple._replace (issue\n #BB-24).\n\n1.5 2014-05-20 Eric V. Smith\n----------------------------\n\n* Support slices in namedlist.__getattr__ (issue #BB-22).\n\n1.4 2014-03-14 Eric V. Smith\n----------------------------\n\n* Add MANIFEST.in to MANIFEST.in, so it will be included in sdists\n (issue #BB-21).\n\n1.3 2014-03-12 Eric V. Smith\n----------------------------\n\n* Support unicode type and field names in Python 2.x (issue #BB-19). The\n identifiers still must be ASCII only, but you can pass them as\n unicode. This is useful for code that needs to run under both Python\n 2 and Python 3.\n\n1.2 2014-02-13 Eric V. Smith\n----------------------------\n\n* Produce an RPM named python-namedlist (issue #BB-17).\n\n* Add namedtuple (issue #BB-10). Passes all of the collections.namedtuple\n tests, except those related to _source. Those tests don't apply\n given our different approach to dynamic class creation. All other\n collections.namedtuple tests have been copied to our test suite.\n\n1.1 2014-02-07 Eric V. Smith\n----------------------------\n\n* Added __dict__ so vars() will be supported.\n\n* Fixed pickling from another module (issue #BB-14).\n\n* Moved tests to a separate file (issue #BB-15).\n\n1.0 2014-02-04 Eric V. Smith\n----------------------------\n\n* Declare the API stable and release version 1.0.\n\n* Support python 2.6 (issue #BB-8). The doctests don't pass because\n OrderedDict isn't available until 2.7.\n\n0.4 2014-02-04 Eric V. Smith\n----------------------------\n\n* Add docstring (issue #BB-7).\n\n* Fixed README.txt typos (thanks pombredanne on bitbucket).\n\n0.3 2014-01-29 Eric V. Smith\n----------------------------\n\n* Removed documentation left over from recordtype.\n\n* Make instances unhashable (issue #BB-2).\n\n* For python3, use str.isidentifier (issue #BB-1).\n\n* Reorganize code for name checking. No functional changes.\n\n* Make instances iterable (issue #BB-3).\n\n* Add collections.Sequence ABC (issue #BB-4).\n\n* Have \"python setup.py test\" also run doctests (issue #BB-5).\n\n0.2 2014-01-28 Eric V. Smith\n----------------------------\n\n* Added MANIFEST.in.\n\n* Hopefully fixed a problem with .rst formatting in CHANGES.txt.\n\n0.1 2014-01-28 Eric V. Smith\n----------------------------\n\n* Initial release.\n\n* Based off my recordtype project, but uses ast generation instead of\n building up a string and exec-ing it. This has a number of advantages:\n\n - Supporting both python2 and python3 is easier. exec has the\n anti-feature of having different syntax in the two languages.\n\n - Adding additional features is easier, because I can write in real\n Python instead of having to write the string version, and deal\n with all of the escaping and syntax errors.\n\n* Added FACTORY, to allow namedlist to work even with mutable defaults.\n\n\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0",
"summary": "Similar to namedtuple, but instances are mutable.",
"version": "1.8",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "a8215eb73b978f249856da86e8b2e997",
"sha256": "826f9178fbe2683f586d0e63056a0e02347445c2bfa49e73295fa0bd5658f4ab"
},
"downloads": -1,
"filename": "namedlist-1.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a8215eb73b978f249856da86e8b2e997",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 15463,
"upload_time": "2020-08-30T00:05:31",
"upload_time_iso_8601": "2020-08-30T00:05:31.820424Z",
"url": "https://files.pythonhosted.org/packages/5a/fe/2bc087aed738aa3ace8fa1e50e4619eaf33b833e5d060fe214a7ed63c1f6/namedlist-1.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "6c05b96989d36c629548b7f96b4e758a",
"sha256": "34f89fc992592c80b39a709e136edcf41ea17f24ba31eaf84a314a02c8b9bcef"
},
"downloads": -1,
"filename": "namedlist-1.8.tar.gz",
"has_sig": false,
"md5_digest": "6c05b96989d36c629548b7f96b4e758a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 21887,
"upload_time": "2020-08-30T00:05:32",
"upload_time_iso_8601": "2020-08-30T00:05:32.902851Z",
"url": "https://files.pythonhosted.org/packages/4b/9e/e4f507ac072cfb7bb3b31deea8f2f25c21f44a2e3deb223e0f0202c297c0/namedlist-1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2020-08-30 00:05:32",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "ericvsmith",
"gitlab_project": "namedlist",
"lcname": "namedlist"
}