diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-10-14 16:05:17 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-10-14 16:05:17 -0700 |
| commit | 9435e01f9e46ed212adf592b008f3036e16c0fbd (patch) | |
| tree | 18131c733afd206a950c4bf2cbeaac726d147b37 /tests | |
| parent | 5971794e5464d166379278c8dcbda0ebb3cc23d5 (diff) | |
Support __bytes
Fixes #1763
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/basics/class_bytes.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/basics/class_bytes.py b/tests/basics/class_bytes.py new file mode 100644 index 000000000..75e2e7244 --- /dev/null +++ b/tests/basics/class_bytes.py @@ -0,0 +1,9 @@ +class C1: + def __init__(self, value): + self.value = value + + def __bytes__(self): + return self.value + +c1 = C1(b"class 1") +print(bytes(c1)) |
