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.
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:08 | admin | set | github: 66599 |
| 2014年09月14日 17:38:11 | berker.peksag | set | resolution: third party stage: resolved |
| 2014年09月14日 17:37:21 | binnisb | set | status: open -> closed |
| 2014年09月14日 17:36:56 | binnisb | set | messages: + msg226879 |
| 2014年09月14日 16:33:55 | rhettinger | set | messages: + msg226875 |
| 2014年09月14日 16:22:15 | rhettinger | set | assignee: rhettinger nosy: + rhettinger |
| 2014年09月14日 15:55:46 | binnisb | create | |