Message284663
| Author |
belopolsky |
| Recipients |
belopolsky, serhiy.storchaka |
| Date |
2017年01月04日.19:49:54 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1483559394.32.0.335371111214.issue29159@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Consider the following code:
$ cat bug.py
from array import array
class C(array):
def __new__(cls):
return array.__new__(cls, 'B', b'abc')
def __index__(self):
raise TypeError
x = C()
print(bytes(x))
It works under python 3.5:
$ python3.5 bug.py
b'abc'
but raises a TypeError under python 3.6:
$ python3.6 bug.py
Traceback (most recent call last):
File "bug.py", line 8, in <module>
print(bytes(x))
File "bug.py", line 6, in __index__
raise TypeError
TypeError
It looks like this was introduced in issue #27704.
(Ref: e/pyq#827) |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2017年01月04日 19:49:54 | belopolsky | set | recipients:
+ belopolsky, serhiy.storchaka |
| 2017年01月04日 19:49:54 | belopolsky | set | messageid: <1483559394.32.0.335371111214.issue29159@psf.upfronthosting.co.za> |
| 2017年01月04日 19:49:54 | belopolsky | link | issue29159 messages |
| 2017年01月04日 19:49:54 | belopolsky | create |
|