Nick Coghlan added the comment:

Eryk's diagnosis sounds right to me, and the suggested patch will get this back 
to working as well as it did in Python 3.5.

However, it's worth noting that that state itself was already broken when it 
comes to zero-argument super() support on the type definition with reversed 
endianness:

```
>>> import ctypes as ct
>>> class SuperText(ct.c_uint32):
...     def __repr__(self):
...         return super().__repr__()
... 
>>> SuperText.__ctype_le__(1)
<SuperText object at 0x7fde526daea0>
>>> SuperText.__ctype_be__(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 3, in __repr__
TypeError: super(type, obj): obj must be an instance or subtype of type
```

The apparently nonsensical error message comes from both the original type and 
the type with swapped endianness having the same representation:

>>> SuperText.__ctype_le__
<class '__main__.SuperText'>
>>> SuperText.__ctype_be__
<class '__main__.SuperText'>

----------

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

Reply via email to