[New-bugs-announce] [issue28790] Error when using Generic and __slots__

Guido van Rossum report at bugs.python.org
Thu Nov 24 15:04:07 EST 2016


New submission from Guido van Rossum:

Proxy for https://github.com/python/typing/issues/332 (issue) and https://github.com/python/typing/pull/334 (fix).

"""
from typing import Generic, TypeVar

class C(Generic[TypeVar('T')]):
	__slots__ = ('potato',)

# ValueError: 'potato' in __slots__ conflicts with class variable
C[int]

This is because bare C is created with a class member descriptor potato, and instantiating it tries to create a class with all the attributes in C.
"""

@ned, I'll leave it up to you whether this is of sufficient severity to put in 3.6rc1 or not.

Do I need to attach the fix as a diff to this bug?

----------
assignee: gvanrossum
messages: 281649
nosy: gvanrossum, ned.deily
priority: normal
severity: normal
status: open
title: Error when using Generic and __slots__
versions: Python 3.5, Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list