[pydotorg-www] Bug in code example on wiki page about BitManipulation
felix.widmaier at web.de
Thu Sep 1 04:39:31 EDT 2016
I just noticed a small bug in the code example for bit fields on this
There is a ctypes.Union defined as follows:
class Flags( ctypes.Union ):
_fields_ = [
("b", Flags_bits ),
("asByte", c_uint8 )
_anonymous_ = ("b")
However, the `_anonymous_` attribute should be a tuple, i.e. the
following would be correct:
_anonymous_ = ("b",)
I guess in the given example it works without the comma since the name
"b" consists of only one character and therefore "b" == ("b",) but
for names with more than one char it does not work like this.
It would be great if someone with permission to edit the page could fix
this (I don't have an account and I think it would not be worth the
effort to create one for such a tiny edit).
This email has been checked for viruses by Avast antivirus software.
More information about the pydotorg-www