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 eryksun
Recipients amaury.forgeotdarc, belopolsky, eryksun, meador.inge, smurfix
Date 2018-04-08.21:51:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523224305.52.0.682650639539.issue33242@psf.upfronthosting.co.za>
In-reply-to
Content
Field names define CField descriptor attributes on the class. Attribute names should be strings, not bytes. There's no syntactically clean way to use a bytes name. Consider the example of a generic property on a class:

    >>> T = type('T', (), {b'p': property(lambda s: 0)})
    >>> t = T()
    >>> t.p
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'T' object has no attribute 'p'

    >>> getattr(t, b'p')
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: getattr(): attribute name must be string

We'd have to dig into the class dict and manually bind the property:

    >>> vars(T)[b'p'].__get__(t)
    0
History
Date User Action Args
2018-04-08 21:51:45eryksunsetrecipients: + eryksun, amaury.forgeotdarc, belopolsky, smurfix, meador.inge
2018-04-08 21:51:45eryksunsetmessageid: <1523224305.52.0.682650639539.issue33242@psf.upfronthosting.co.za>
2018-04-08 21:51:45eryksunlinkissue33242 messages
2018-04-08 21:51:45eryksuncreate