11 Jan
2021
11 Jan
'21
8:31 p.m.
On 12/01/21 2:21 pm, Larry Hastings wrote:
Slots intelligently support inheritance, too.
Are you sure about that? My experiments suggest that it has the same problem as __annotations__: Python 3.8.2 (default, Mar 23 2020, 11:36:18) [Clang 8.1.0 (clang-802.0.42)] on darwin Type "help", "copyright", "credits" or "license" for more information.
class C: ... __slots__ = ['a', 'b'] ... class D(C): ... __slots__ = ['c', 'd'] ... class E(D): ... pass ... C.__slots__ ['a', 'b'] D.__slots__ ['c', 'd'] E.__slots__ ['c', 'd']
-- Greg