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.

Author serhiy.storchaka
Recipients Claudiu.Popa, akuchling, benjamin.peterson, gvanrossum, serhiy.storchaka, vstinner
Date 2013-10-02.21:53:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1380750807.46.0.339681177518.issue19146@psf.upfronthosting.co.za>
In-reply-to
Content
> Me neither, but you can't change a function that returns a list of 4-tuples
> into a function that returns a list of 5-tuples without breaking existing
> code. IIRC for struct and time tuples we created a hack in C where we
> return something that behaves like an N-tuple but has some extra attributes
> -- but I don't think collections.namedtuple supports that.

It do.

class tb_entity(namedtuple('tb_entity', 'filename lineno name line')):
    def __new__(cls, filename, lineno, name, line, frame=None):
        self = super().__new__(cls, filename, lineno, name, line)
        self.frame = frame
        return self
History
Date User Action Args
2013-10-02 21:53:27serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, akuchling, vstinner, benjamin.peterson, Claudiu.Popa
2013-10-02 21:53:27serhiy.storchakasetmessageid: <1380750807.46.0.339681177518.issue19146@psf.upfronthosting.co.za>
2013-10-02 21:53:27serhiy.storchakalinkissue19146 messages
2013-10-02 21:53:27serhiy.storchakacreate