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 Tim.Graham
Recipients Tim.Graham, ncoghlan
Date 2016-09-20.12:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
As requested by Nick [0], this is a usability issue against CPython 3.6 to provide a better chained TypeError in this case:

class _TokenType(tuple):
    parent = None

    def __getattr__(self, name):
        new = _TokenType(self + (name,))
        setattr(self, name, new)
        new.parent = self
        return new

Token = _TokenType()

Keyword = Token.Keyword

class KeywordCaseFilter(object):
    ttype = Keyword

Traceback (most recent call last):
  File "", line 14, in <module>
    class KeywordCaseFilter(object):
TypeError: '_TokenType' object is not callable

The exception should report the specific object with the problematic __set_name__ attribute (rather than just passing along the underlying exception), as well as supporting __set_name__ = None to explicitly disable further lookup processing.

Follow up to #27366.

Date User Action Args
2016-09-20 12:38:42Tim.Grahamsetrecipients: + Tim.Graham, ncoghlan
2016-09-20 12:38:42Tim.Grahamsetmessageid: <>
2016-09-20 12:38:42Tim.Grahamlinkissue28214 messages
2016-09-20 12:38:42Tim.Grahamcreate