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 Sec42
Recipients Sec42
Date 2022-02-26.11:37:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1645875469.77.0.975365502417.issue46866@roundup.psfhosted.org>
In-reply-to
Content
When trying to extend the builtin bytes class, slices fall back to the builtin class.

```
class my_bytes(bytes):
  def dummy(self):
    print("dummy called")


x=my_bytes.fromhex("c0de c0de")
print(x.__class__)

print(x[1:].__class__)

```

x.__class__ returns <class '__main__.my_bytes'> as expected.

But x[1:].__class__ returns <class 'bytes'>
History
Date User Action Args
2022-02-26 11:37:49Sec42setrecipients: + Sec42
2022-02-26 11:37:49Sec42setmessageid: <1645875469.77.0.975365502417.issue46866@roundup.psfhosted.org>
2022-02-26 11:37:49Sec42linkissue46866 messages
2022-02-26 11:37:49Sec42create