[issue24931] _asdict breaks when inheriting from a namedtuple

Samuel Isaacson report at bugs.python.org
Tue Aug 25 01:49:48 CEST 2015


New submission from Samuel Isaacson:

When inheriting from namedtuples, _asdict and __dict__ return empty dictionaries:

    from collections import namedtuple

    class Point(namedtuple('_Point', ['x', 'y'])):
        pass

    a = Point(3, 4)
    print(a._asdict() == {})

gives False; it is True on Python 2.7.6

----------
components: Library (Lib)
messages: 249082
nosy: Samuel Isaacson
priority: normal
severity: normal
status: open
title: _asdict breaks when inheriting from a namedtuple
type: behavior
versions: Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24931>
_______________________________________


More information about the Python-bugs-list mailing list