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 zzzeek
Recipients zzzeek
Date 2020-08-24.23:32:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org>
In-reply-to
Content
This is likely related or a dupe of https://bugs.python.org/issue29270, but the error message is different.  I'm posting this to confirm it's the same issue, or not, and to at least provide a google result for people who also see this error as 29270 seems to imply this might not be fixable.

Like 29270, it involves the fact that the interpreter seems to be looking at my super() call inside of a method without actually calling it, and then getting upset about __classcell__:



from typing import NamedTuple


class X(NamedTuple):
    a: str
    b: str

    # comment this out to remove the issue
    def foo(self):
        return super(X, self)


and that's it!  on my interpreter:

Python 3.8.3 (default, May 23 2020, 16:34:37) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] on linux

I get:

$ python test3.py 
Traceback (most recent call last):
  File "test3.py", line 4, in <module>
    class X(NamedTuple):
RuntimeError: __class__ not set defining 'X' as <class '__main__.X'>. Was __classcell__ propagated to type.__new__?

The most surprising thing is that this seems extremely basic and google is not finding this error message for me.
History
Date User Action Args
2020-08-24 23:32:59zzzeeksetrecipients: + zzzeek
2020-08-24 23:32:59zzzeeksetmessageid: <1598311979.7.0.775389193479.issue41629@roundup.psfhosted.org>
2020-08-24 23:32:59zzzeeklinkissue41629 messages
2020-08-24 23:32:59zzzeekcreate