We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2922e3 commit 7effca3Copy full SHA for 7effca3
1 file changed
tests/snippets/builtin_ord.py
@@ -3,7 +3,11 @@
3
assert ord("a") == 97
4
assert ord("é") == 233
5
assert ord("🤡") == 129313
6
+assert ord(b'a') == 97
7
+assert ord(bytearray(b'a')) == 97
8
9
assert_raises(TypeError, lambda: ord(), "ord() is called with no argument")
10
assert_raises(TypeError, lambda: ord(""), "ord() is called with an empty string")
11
assert_raises(TypeError, lambda: ord("ab"), "ord() is called with more than one character")
12
+assert_raises(TypeError, lambda: ord(b"ab"), "ord() expected a character, but string of length 2 found")
13
+assert_raises(TypeError, lambda: ord(1), "ord() expected a string, bytes or bytearray, but found int")
0 commit comments