Message315097
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 |
|
Date |
User |
Action |
Args |
2018-04-08 21:51:45 | eryksun | set | recipients:
+ eryksun, amaury.forgeotdarc, belopolsky, smurfix, meador.inge |
2018-04-08 21:51:45 | eryksun | set | messageid: <1523224305.52.0.682650639539.issue33242@psf.upfronthosting.co.za> |
2018-04-08 21:51:45 | eryksun | link | issue33242 messages |
2018-04-08 21:51:45 | eryksun | create | |
|