This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: namedtuples bug between 3.3.2 and 3.4.1
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: binnisb, dstufft, eric.araujo, rhettinger
Priority: normal Keywords:

Created on 2014-09-14 15:55 by binnisb, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg226873 - (view) Author: Brynjar Smári Bjarnason (binnisb) Date: 2014-09-14 15:55
In Python 3.4.1 installed with Anaconda. I tried the following
(expecting an OrderedDict as result):

>>>from collections import namedtuple
>>>NT = namedtuple("NT",["a","b"])
>>>nt = NT(1,2)
>>>print(vars(nt))
{}

so the result is an empty dict. In Python 3.3.2 (downgraded in the
same Anaconda environment) results in:

>>>print(vars(nt))
OrderedDict([('a', 1), ('b', 2)])
msg226875 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-09-14 16:33
> so the result is an empty dict.

It works fine for me in the standard distribution:

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 00:54:21) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> from collections import namedtuple
>>> NT = namedtuple("NT",["a","b"])
>>> nt = NT(1,2)
>>> print(vars(nt))
OrderedDict([('a', 1), ('b', 2)])

There may be something amiss with the Anaconda distribution.  I suggest reporting this to Continuum IO (the producers of that distribution).
msg226879 - (view) Author: Brynjar Smári Bjarnason (binnisb) Date: 2014-09-14 17:36
Thanks, I'll report it to Continuum IO.
History
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66599
2014-09-14 17:38:11berker.peksagsetresolution: third party
stage: resolved
2014-09-14 17:37:21binnisbsetstatus: open -> closed
2014-09-14 17:36:56binnisbsetmessages: + msg226879
2014-09-14 16:33:55rhettingersetmessages: + msg226875
2014-09-14 16:22:15rhettingersetassignee: rhettinger

nosy: + rhettinger
2014-09-14 15:55:46binnisbcreate