New submission from Raymond Hettinger <raymond.hettin...@gmail.com>:

Given:

    class A:
        __slots__ = ['x', 'y', 'z')

    mo = vars(A)['x']

The field number should be viewable:

    >>> mo.offset
    0

And the __repr__ should be:

    >>> mo
    <member 'x' at slot_offset 0 of 'A' objects>

----------
components: Interpreter Core
keywords: easy (C)
messages: 366356
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Make member objects inspectable.
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40276>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to