Skip to content

The test programs, run in this browser

Generated on 2026-09-12 by running every case through this site's own compiler and runtime

d/Python is tested with a set of 66 small Python programs, each with the exact text it must print. Every program has to print that text under real CPython (version 3.9.6, the reference build all tests are checked against) and under d/Python. That is how we know a feature works the way Python works, not just the way we think it does.

This page is the third check. When the site was built, every single-file program was compiled and run by the very same compiler and runtime you get in the playground, and its output was compared character for character with the expected text. Nothing below is typed by hand. The programs are MIT-licensed and written for this project; you can read and run every one.

62 / 62single-file programs whose output in this browser build matches the expected text exactly
62 / 62single-file programs the browser compiler accepts
4programs made of several files (imports and packages); they are tested on the command line, because the browser compiler takes one file at a time
1program that asks a question with input(); the test answered it from a script

Every program

Exact means it compiled, ran to the end without an error, and printed the expected text exactly. Click a name to read its source; Run opens it in the playground and runs it. The last column links to the part of the Python documentation the program was written to test.

Program Lines In this browser Compiled size (bytes) Python docs
arithmetic · Run 4 exact 759 reference/expressions
tutorial_fibonacci · Run 6 exact 380 reference/../tutorial/introduction
functions · Run 14 exact 2090 reference/compound_stmts
evaluation · Run 9 exact 3548 reference/expressions
strings · Run 5 exact 682 reference/../library/stdtypes
loops · Run 19 exact 762 reference/compound_stmts
classes · Run 44 exact 6698 tutorial/classes
lists · Run 42 exact 15747 tutorial/datastructures
exceptions · Run 100 exact 7716 reference/compound_stmts
recursion · Run 67 exact 5767 reference/executionmodel
slicing · Run 28 exact 25195 library/stdtypes
tuples · Run 48 exact 12055 library/stdtypes
dictionaries · Run 73 exact 31701 library/stdtypes
dictionary_views · Run 76 exact 34474 library/stdtypes
dictionary_construction · Run 33 exact 19678 library/stdtypes
sets · Run 70 exact 125551 library/stdtypes
text_methods · Run 24 exact 21009 library/stdtypes
integer_conversion · Run 20 exact 10137 library/functions
list_methods · Run 44 exact 22868 tutorial/datastructures
sequence_iteration · Run 32 exact 9724 reference/compound_stmts
membership · Run 38 exact 21858 reference/expressions
type_checks · Run 67 exact 19655 library/functions
container_rebinding · Run 50 exact 25528 reference/simple_stmts
object_protocols · Run 83 exact 14577 reference/datamodel
representation_mutation · Run 42 exact 11118 reference/datamodel
ranges · Run 86 exact 59875 library/stdtypes
reductions · Run 48 exact 27219 library/functions
summation · Run 32 exact 18004 library/functions
extrema · Run 36 exact 33019 library/functions
callables · Run 44 exact 8466 reference/datamodel
extrema_keys · Run 60 exact 30964 library/functions
bound_methods · Run 52 exact 17174 reference/datamodel
function_signatures · Run 58 exact 14665 tutorial/controlflow
function_defaults · Run 45 exact 8854 tutorial/controlflow
iterators · Run 77 exact 69680 library/stdtypes
closures · Run 154 exact 27751 reference/executionmodel
sorting · Run 62 exact 47309 howto/sorting
call_unpacking · Run 56 exact 16080 reference/expressions
display_unpacking · Run 49 exact 35642 reference/expressions
module_environment · Run 47 exact 5092 library/main
bitwise · Run 27 exact 13852 library/stdtypes
integer_formatting · Run 14 exact 4818 library/functions
shifts · Run 34 exact 9304 library/stdtypes
source_modules 13 multi-module 3 source files; the browser compiler takes one file, so this case is proven by the conformance suite and the command line, not here tutorial/modules
class_exports 27 multi-module 3 source files; the browser compiler takes one file, so this case is proven by the conformance suite and the command line, not here tutorial/classes
circular_modules 12 multi-module 3 source files; the browser compiler takes one file, so this case is proven by the conformance suite and the command line, not here reference/import
source_packages 8 multi-module 5 source files; the browser compiler takes one file, so this case is proven by the conformance suite and the command line, not here reference/import
callable_objects · Run 29 exact 10498 reference/datamodel
print_options · Run 97 exact 9211 library/functions
utf8_encoding · Run 33 exact 6035 library/stdtypes
bytes_indexing · Run 28 exact 6415 library/stdtypes
divmod · Run 61 exact 12636 library/functions
ascii · Run 65 exact 15559 library/functions
reversed · Run 78 exact 42682 library/functions
ord · Run 59 exact 22662 library/functions
chr · Run 53 exact 17502 library/functions
list_sort · Run 104 exact 53281 library/stdtypes
generator_expressions · Run 107 exact 75447 reference/expressions
filter · Run 66 exact 41815 library/functions
iterator_protocols · Run 43 exact 27330 reference/datamodel
context_managers · Run 50 exact 10877 reference/compound_stmts
index_protocols · Run 44 exact 11700 reference/datamodel
generator_clauses · Run 32 exact 38701 reference/expressions
input_calls · Run 12 exact 7093 library/functions
map · Run 25 exact 24150 library/functions
pow · Run 21 exact 11775 library/functions

What the results mean

  • exact: the output matched the expected text character for character. The size is the compiled program file the browser compiler produced today; shared libraries it uses are separate files and not counted.
  • multi-module: the program imports other files or a package. The browser compiler takes one file at a time, so these are tested on the command line instead.
  • Anything else would be a bug in this build, and it would be printed in bold here so it could not hide.

Expected outputs

This is the exact text each program must print. Long outputs are shown in full so you can compare for yourself.

arithmetic

Source: corpus/arithmetic.py · Run in the playground

1000000000000000000000000000001
-4 3 -4 -3
3 -2 0 838102050
1267650600228229401496703205376 -32 1

tutorial_fibonacci

Source: corpus/tutorial_fibonacci.py · Run in the playground

0 1 1 2 3 5 8 13 21 34 55 89 

functions

Source: corpus/functions.py · Run in the playground

11 10 7 negative
7

evaluation

Source: corpus/evaluation.py · Run in the playground

left:right:left|right
0:0
4:4
3:2:False
1:2:3:True

strings

Source: corpus/strings.py · Run in the playground

café 🌍 6 2
True True ab
True / False / None!
value=12345678901234567890, flag=True, text=café 🌍

loops

Source: corpus/loops.py · Run in the playground

complete 50
5 4 3 
while done 0

classes

Source: corpus/classes.py · Run in the playground

True False True True
8 8 0
12 15 15
counter:8 counter:0 counter:15
True False True
updated updated updated updated
own updated
True False True
True False
receiver:amount:12

lists

Source: corpus/lists.py · Run in the playground

[10, 20, 99, 40] True 4 True
10 40
[2, 20, 99, 40] [10, 20, 99, 40] False False
50 [10, 20, 99, 40, 50]
199
[50, 40, 99, 20, 10]
10 [50, 40, 99, 20, 10, 50, 40, 99, 20, 10]
[] 0 False True
['café', "it's nice", 'a"b', '\t\n\r\\\x00\u200b\u2028🌍']
b'a\x00\xff\n'
[0, 4, 16, 36] 99 True True
[0, 4, 16, 36, 64, 100]
[[0, 1, 2], [10, 11, 12]]
string='a'

exceptions

Source: corpus/exceptions.py · Run in the playground

2
ok
cleanup
ZeroDivisionError integer division or modulo by zero
cleanup
-3
ok
cleanup
IndexError list index out of range
ValueError('original')
inner final
ValueError original
return final
7
2
loop final 0
loop final 1
AssertionError expected
RuntimeError() True
body
else final
KeyError 'missing'
TypeError replacement
9
after nested loop
outer loop final

recursion

Source: corpus/recursion.py · Run in the playground

265252859812191058636308480000000
144 True False False
unwind 1
unwind 2
unwind 3
ZeroDivisionError
120
0
restored outer
no lingering exception

slicing

Source: corpus/slicing.py · Run in the playground

A Z é 😀
Aé😀Z Z😀éA é😀 Zé A😀
'' '' 'Z😀éA'
Aé😀Z A Z
0 255 127 b'\xff\x80\x7f\x00' b'\x7f\x80'
[10, 20, 30, 40, 50] [99, 30, 10] [10, 20, 30, 40, 50] [10, 30, 50] [50, 30]
[] [] [10] [50]
bounds
bounds
bounds
bounds
ValueError slice step cannot be zero
start
stop
step
éZ

tuples

Source: corpus/tuples.py · Run in the playground

() () (7,) ('é', 1000000000000000000000000000000, True, None, b'\xff')
0 5 False True
é b'\xff' True 7
True True True True False
(7, 'two') ((), (1, (2,)))
7 sum [3, 4]
[3, 4, 8]
10
30
10
30
bounds
immutable é
1 2 3 4
[(0, 0), (1, 1), (2, 4), (3, 9)]
Ada 3
Lin 4
8
9
10
too few
too many

dictionaries

Source: corpus/dictionaries.py · Run in the playground

{} 0 False True False
{'red': 3, 'blue': 2, 'green': 1} 3 True
3 -1 True True
{'red': 3, 'blue': 20, 'green': 1} True
True False
{'red': 3, 'blue': 20, 'green': 1} {'red': 30, 'blue': 20, 'green': 1}
{'third': 3, 'first': 10, 'second': 2}
{'third': 3, 'first': 10, 'second': 22, 'fourth': 4}
10 -1 {'third': 3, 'second': 22, 'fourth': 4}
3 4 {'second': 22}
{'second': 22, 'third': 33}
22 99 {'second': 22, 'third': 33, 'new': 99}
True
True False False
{'items': [1, 2, 3]} {'items': [1, 2, 3]} True True
3
'missing' KeyError('missing')
{10000000000000000000000000: 'large', -2: 'negative'} negative
42 KeyError(42)
{('x', 1): 'one', ('y', 2): 'two'} one True
('z', 3) KeyError(('z', 3))
42 Exception(42)
None ValueError(None)
b'\xff' KeyError(b'\xff')
('x', 1) Exception(('x', 1))
 Exception() Exception('')
key
value
{'a': 7}
value
receiver
key
7
key
value
7
{} False 0 True {'red': 3, 'blue': 20, 'green': 1, 'a': 7}
{'after': 1}

dictionary_views

Source: corpus/dictionary_views.py · Run in the playground

dict_keys(['alpha', 'beta']) dict_values([1, 2]) dict_items([('alpha', 1), ('beta', 2)]) 2 True
dict_keys(['alpha', 'beta', 'gamma']) dict_values([10, 2, 3]) dict_items([('alpha', 10), ('beta', 2), ('gamma', 3)]) [('alpha', 1), ('beta', 2)]
True True True True
True True
True False ['alpha', 'beta', 'gamma']
alpha 11
beta 3
gamma 4
keys complete
alpha 11
gamma 4
items complete
11
['alpha', 'beta', 'gamma'] [22, 6, 8]
{'alpha': 110, 'gamma': 40}
{0: 0, 2: 4, 4: 16} 99
{0: 0, 1: 0, 2: 1}
key 0
value 0
key 1
value 1
{0: 0, 1: 3}
dict_keys(['alpha', 'gamma']) dict_values([11, 4]) dict_items([('alpha', 11), ('gamma', 4)]) 2
KeyError('beta')
dictionary changed size during iteration
['alpha', 'gamma', 'delta']
dictionary changed size during iteration
['gamma', 'delta']
dict_keys([]) dict_values([]) dict_items([]) 0 False
dict_keys(['fresh']) dict_values([7]) dict_items([('fresh', 7)])
dict_keys(['ready'])
dict_items([('saved', 42)])

dictionary_construction

Source: corpus/dictionary_construction.py · Run in the playground

{} {} {}
{'alpha': 1, 'beta': 2}
{'a': 3, 'b': 2}
{1: 'one', 2: 'two'}
{'a': 1, 'b': 20, 'c': 3} {'a': 1, 'b': 2}
{'a': 1, 'b': 2}
{'a': 10, 'b': 20, 'c': 3, 'd': 4}
None
{'a': 10, 'b': 20, 'c': 3, 'd': 4}
None None {'a': 10, 'b': 20, 'c': 3, 'd': 4}
('d', 4)
('c', 3)
('b', 20)
('a', 10)
'popitem(): dictionary is empty' KeyError('popitem(): dictionary is empty')
empty
invalid pair
{'a': 9, 'b': 2}
{None: 'none'} {True: 'yes', False: 'no'}
none yes

sets

Source: corpus/sets.py · Run in the playground

3 True True True
True True
True False
0 False 3
True True
True True
True True True True False True
True True True
True
True True
True
True True
True True
True True
True True
True
0 True
6
True
True 2 True
empty pop
KeyError(1)
set() frozenset()
2 True True
True
True
True True
True
True
True
True True
True True

text_methods

Source: corpus/text_methods.py · Run in the playground

'café::tea::::🙂' ['café', 'tea', '', '🙂'] ['café::tea::', '🙂']
café | tea |  | 🙂
6 11 3
True True
('café', '::', 'tea::::🙂') ('café::tea::', '::', '🙂')
'-é-🙂-' 'café/tea::::🙂'
['one\t two  '] ['  one\t two']
[b'\x00\xff', b'a', b'', b'b', b''] [b'\x00\xff::a::::b', b'']
1 0 4
b'\xff::a::::b' b'\xff|a'
-1 1 False
ValueError('substring not found')
ValueError('empty separator')

integer_conversion

Source: corpus/integer_conversion.py · Run in the playground

0 1 0 -123456789012345678901234567890
-12345 678 255
31 123 123
5 -63 1295 0
100000000000000000000000000000000000000
ValueError("invalid literal for int() with base 0: '0x_'")
ValueError("invalid literal for int() with base 0: '00_1'")
ValueError("invalid literal for int() with base 0: '1__2'")
ValueError("invalid literal for int() with base 0: '\\x1c123'")
ValueError("invalid literal for int() with base 0: '123\\x1e'")
ValueError("invalid literal for int() with base 0: ''")
ValueError('int() base must be >= 2 and <= 36, or 0')
ValueError("invalid literal for int() with base 10: b'\\xff'")

list_methods

Source: corpus/list_methods.py · Run in the playground

1 None 1 1 [2, 9]
[7, 8, 9, 10, 11] [7, 8, 10, 11] True False
['é', '🙂'] [0, 255] []
['red', 'blue'] [('red', 1), ('blue', 2)]
['é', '🙂', 'red', 'blue']
ValueError('99 is not in list')
ValueError('list.remove(x): x not in list')
IndexError('pop index out of range')
IndexError('pop from empty list')
[1, 2] [[1, 2]] True

sequence_iteration

Source: corpus/sequence_iteration.py · Run in the playground

a
é
🙂
complete 🙂 changed
[255, 97]
{'a': 'a!', 'b': 'b!'}
[2, 3]
[2, 9] x
[7] True
IndexError('string index out of range')
IndexError('list assignment index out of range')
IndexError("cannot fit 'int' into an index-sized integer")

membership

Source: corpus/membership.py · Run in the playground

True False
True False
True False
True False
True False
False True
False True
True True
True True
True True
True False
True False
True False
True False
False True
ValueError('byte must be in range(0, 256)')
True True
False True
True True
True True
ValueError('byte must be in range(0, 256)')
ValueError('byte must be in range(0, 256)')
True True False
False True False
True False False
True False False
True False False
False True False
True True False
True True
1 1 0
True True True True True True
False False True False False
True False
needle
container
True
True True False True
2 1 0 True
[0, 1, 2]

type_checks

Source: corpus/type_checks.py · Run in the playground

True False False False False False False False False False True
False False False False
True True False False False False False False False False True
True False False False
False False True False False False False False False False True
True False False False
False False False True False False False False False False True
True False False False
False False False False True False False False False False True
False False False False
False False False False False True False False False False True
False False False False
False False False False False False True False False False True
False False False False
False False False False False False False True False False True
False False False False
False False False False False False False False True False True
False False False False
False False False False False False False False False True True
False False False False
False False False False False False False False False False True
False False False False
False False False False False False False False False False True
False False True False
False False False False False False False False False False True
False False True True
False False False False False False False False False False True
False False False False
True False True False
True True False True
evaluated
False
evaluated
TypeError('isinstance() arg 2 must be a type or tuple of types')
True
TypeError('issubclass() arg 2 must be a class or tuple of classes')
True
False
True True True
False True False
False False
class argument evaluated
True
class argument evaluated
True
TypeError('issubclass() arg 1 must be a class')
TypeError('isinstance() arg 2 must be a type or tuple of types')

container_rebinding

Source: corpus/container_rebinding.py · Run in the playground

[2, 3, 4] [1] False
[3] [1]
[1, 2] [3, 4] [3, 4]
[1]
[[5, 6], [2, 3, 7], [4]]
{'b': [3, 4]} {'a': [1]} True
{'c': [5]} {'b': [3, 4]}
True True False
True
[2, 3]
[8, 9] [1]

object_protocols

Source: corpus/object_protocols.py · Run in the playground

Basket(0) Basket(0) Basket(0)
length 0
0
length 0
False
Basket(2) Basket(2) Basket(2)
length 2
2
length 2
True
Basket(9223372036854775807) Basket(9223372036854775807) Basket(9223372036854775807)
length 9223372036854775807
9223372036854775807
length 9223372036854775807
True
Basket(-1) Basket(-1) Basket(-1)
length -1
ValueError('__len__() should return >= 0')
length -1
ValueError('__len__() should return >= 0')
Basket(-9223372036854775808) Basket(-9223372036854775808) Basket(-9223372036854775808)
length -9223372036854775808
ValueError('__len__() should return >= 0')
length -9223372036854775808
ValueError('__len__() should return >= 0')
Basket(-9223372036854775809) Basket(-9223372036854775809) Basket(-9223372036854775809)
length -9223372036854775809
ValueError('__len__() should return >= 0')
length -9223372036854775809
ValueError('__len__() should return >= 0')
Basket(9223372036854775808) Basket(9223372036854775808) Basket(9223372036854775808)
length 9223372036854775808
OverflowError("cannot fit 'int' into an index-sized integer")
length 9223372036854775808
OverflowError("cannot fit 'int' into an index-sized integer")
length 3
3 Basket(3) Basket(2) named
boolean
True
[Basket(1), Basket(2)] (Basket(3),)
1 True
TypeError("'str' object cannot be interpreted as an integer")
TypeError('__repr__ returned non-string (type int)')
TypeError('__str__ returned non-string (type int)')
TypeError('__bool__ should return bool, returned int')
TypeError("object of type 'Unsized' has no len()")
cleaned length
ValueError('length failure')
ValueError('repr failure')

representation_mutation

Source: corpus/representation_mutation.py · Run in the playground

[1, 2]
[1, 3]
{'a': 1}
[1] 0
{'a': 1, 'b': 2}

ranges

Source: corpus/ranges.py · Run in the playground

range(0, 0) 0 0 1 0 False []
True False True
False True;False True;False True;False True;False True;False True;False True;False True;
range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;
range(0, 5) 0 5 1 5 True [0, 1, 2, 3, 4]
False True True
False True;True False;True False;True False;True False;True False;False True;False True;
range object index out of range;3;4;0;1;2;range object index out of range;
range(2, 9, 3) 2 9 3 3 True [2, 5, 8]
True True True
False True;False True;False True;True False;False True;False True;True False;False True;
range object index out of range;5;8;2;5;8;range object index out of range;
range(9, 1, -3) 9 1 -3 3 True [9, 6, 3]
True True True
False True;False True;False True;False True;True False;False True;False True;True False;
range object index out of range;6;3;9;6;3;range object index out of range;
range(1, 9, -1) 1 9 -1 0 False []
True False True
False True;False True;False True;False True;False True;False True;False True;False True;
range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;range object index out of range;
True True False
True True True
True False False
True False
[0, 1, 2, 3] [0, 1, 2, 3]
[0, 1] [0, 1, 2, 3]
[5, 3, 1] range(5, -1, -2)
[5, 4, 3, 2, 1, 0] range(5, -1, -1)
[0, 1, 2, 3, 4, 5] range(0, 6)
[0, 2, 4] range(0, 6, 2)
range(4, 16, 6) range(19, -2, -3)
range(9, -1, -999999999999999999999)
3000000000000000000000000000000 9999999999999999999999999999999999999999 True False
range(3000000000000000000000000000000, 3000000000000000000000000000012, 3) [3000000000000000000000000000000, 3000000000000000000000000000003, 3000000000000000000000000000006, 3000000000000000000000000000009]
OverflowError('Python int too large to convert to C ssize_t')
ValueError('range() arg 3 must not be zero')
ValueError('range() arg 3 must not be zero')
ValueError('slice step cannot be zero')
0 2 4 

walk 0
cleanup 0
cleanup 1
walk 2
cleanup 2
cleanup 3
[] [2, 4, 6]
range(True, 5) [1, 2, 3, 4]
True True
[1, 0, 1, 0]
range(True, 5) True 5 True True [1, 2, 3, 4]
range(0, True) True range(0, 1)
0
ValueError('-2 is not in range')
0
ValueError('0 is not in range')
0
ValueError('1 is not in range')
1
0
0
ValueError('5 is not in range')
1
3
0
ValueError('10000000000000000000000000000000000000000 is not in range')
1 1 0
ValueError('sequence.index(x): x not in sequence')
1000000000000000000000000000000
original {range(0, 3, 2): 'original'}
True
ValueError(range(0, 3)) range(0, 3)

reductions

Source: corpus/reductions.py · Run in the playground

True False True False True False
True True False False
False True
True False True False False
True False True
True False True True True
test 0
test 1
test 0
True False
test 1
test 0
test 0
test 1
False True
length 1
length 0
False
changing 0
changing 1
changing 2
True 3
RuntimeError('dictionary changed size during iteration')
TypeError('__bool__ should return bool, returned int')
True True

summation

Source: corpus/summation.py · Run in the playground

0 0 10 16 13
2 4 352
3 6 3
4 True None None
[7] [7, 1, 2, 3] False
True
TypeError("sum() can't sum strings [use ''.join(seq) instead]")
TypeError("sum() can't sum bytes [use b''.join(seq) instead]")
True
2 2 2 -1 -1 1 -2 -1 1
-1 -2 0 -10000000000000000000000000
3 0 1 0 1 3 1
ZeroDivisionError('integer division or modulo by zero')
iterable evaluated
start evaluated
13

extrema

Source: corpus/extrema.py · Run in the playground

1 -1 10000000000000000000000000000000000000000000000000 True
1 3 1 3
a 🙂 0 255
2 4 2 9
0 4 1 9
True True
empty None 99 empty
2 4 2
1 2
3 4
ValueError('min() arg is an empty sequence')
ValueError('max() arg is an empty sequence')
argument 3
argument 1
argument 2
1
True
ValueError('max() arg is an empty sequence')
9
0 999

callables

Source: corpus/callables.py · Run in the playground

7 13 8 -5
10 11 -9
True False True True
True 1 True False False
True True True False
add __main__ function
5 2 abs builtin_function_or_method
3 42
5 True 6
receiver
7
callable
argument
7
ValueError(7)

extrema_keys

Source: corpus/extrema_keys.py · Run in the playground

key -3
key 3
key -4
-3
key -3
key 3
key -4
-4
aa a
0 -4
task first
task second
task third
True
task first
task second
task third
True
empty
99
default expression
key expression
key -4
key 2
2
key expression
default expression
key -4
key 2
-4
grow 3
grow 1
grow 0
0 [3, 1, 0]
RuntimeError('dictionary changed size during iteration')
ValueError('key failed')
-2 empty

bound_methods

Source: corpus/bound_methods.py · Run in the playground

12 102 True
True False True True
False False True
True True False
True score __main__
method function score
True True True True
13 103 14
15 16
17 18
True True False
2 4
19 True
receiver
argument
12
22 23
7 True True

function_signatures

Source: corpus/function_signatures.py · Run in the playground

1 3 ('x', True) 9 named {'last': 7, 'first': 8}
('x', True) {'last': 7, 'first': 8}
4 2 () 6 explicit {}
21 16
() (1, 'two', False)
{'a': 10, 'b': 2, 'inside': 9} {'b': 3, 'a': 4, 'inside': 9} False
5 {'name': 6}
{'trace': 5}
15 15
{'source': 3}
7
15
positional
c
b
1 1 1
[1, 2, 3]
3

function_defaults

Source: corpus/function_defaults.py · Run in the playground

default created
defined
[10, 6, 7] [10, 6, 7] True
[99, 4] [10, 6, 7]
7 8
5
first
second
third
1 1 1
[1, 1] [1, 1]
unused default
7 102

iterators

Source: corpus/iterators.py · Run in the playground

True True True False True
10 20 [30] []
-1 -2
StopIteration StopIteration() True
0
1
[2, 3]
[4, 5] [99]
[1, 2, 3] ['a', 'é', '🙂'] [0, 255, 65]
empty empty
100000000000000000000000000000000000000000000000000 100000000000000000000000000000000000000000000000003 [100000000000000000000000000000000000000000000000006, 100000000000000000000000000000000000000000000000009]
[(-2, 'a'), (-1, 'b')]
[(1, 'a'), (2, 'b')]
[(100000000000000000000000000000000000000000000000000, 7), (100000000000000000000000000000000000000000000000001, 8)]
[(1, 'a'), (2, 'b')] [] []
done done 3
done done 3
[(1, 2), (3, 4)] 0
True 4
False 4
True 3 True 0
10 1 3
True
[9, 1, 2]
0 a
2 c
complete
1
2
list_iterator tuple_iterator str_iterator bytes_iterator
enumerate zip
7
{'a': 1, 'b': 2}
[9, 1, 2, 3, 4]
empty 2
[0, 2, 4, 6]
1
3 0
True True False False
[1, 2, 3] [5, 3, 1, -1]

closures

Source: corpus/closures.py · Run in the playground

42 43 10 True False
True True True function <lambda> __main__
12 13 13 17 110 112 17
(3, 8)
[1, 2, 4] [9, 3] [1, 2, 4]
append True False
2 2 2 False
12 17 19
11 1
closure failure 6
16
None False
(7, [0, 1, 2])
32
12 text
4 103
240
50
2 ab

sorting

Source: corpus/sorting.py · Run in the playground

[-9, -2, 0, 1, 3, 3] [3, -2, 3, 0, -9, 1] True False
[3, 3, 1, 0, -2, -9] [3, 3, 1, 0, -2, -9]
[] [7] ['a', 'é', '🙂'] [97, 98, 99]
[-1, 1, 3, 5] [1, 3, 4]
[('a', 1), ('d', 1), ('b', 2), ('c', 2)]
[('b', 2), ('c', 2), ('a', 1), ('d', 1)]
[('a', 1), ('b', 2), ('c', 2), ('d', 1)]
[-9, 3, 3, -2, 1, 0]
[3, -2, 3, 0, -9, 1]
remaining -1
remaining -1
remaining -1
[1, 2, 3]
[1, 2, 3] []
['b', 'a', 'c'] True
[4, 2, 5, 0]
key failed
Python int too large to convert to C int
[2, 1]
[1, 2] ('a', 1)
[3, 2, 1]

call_unpacking

Source: corpus/call_unpacking.py · Run in the playground

1 two 3 expanded
4 five 6 mixed
7 eight 0 alias
(1, 'a', True, 2) {'third': 3, 'first': 1, 'second': 2}
() {'a': 3, 'b': 2}
() {'a': 1, 'b': 2}
star
keyword
1 two 9 default
first a
b
last a
() {'a': 3, 'b': 2}
15
16
18
20
7 [3, 2, 1]
() {}
120
callee
positional
named
8 nine 0 chosen
before failure
argument failed

display_unpacking

Source: corpus/display_unpacking.py · Run in the playground

[0, 1, 2, 3, 4, 5, 6, 7]
['a', 'é', '🙂'] [0, 255]
['b', 'a'] [2, 1]
4 [5, 6] 99
(1, 'two', True, None, 3)
(1, 2, 3, 4, 5, 6)
7 8 9
[1, 2, 4, 1, 2, 3]
[1, 2, 3]
first
middle
last
[1, 2, 3, 4, 5]
tuple first
tuple last
(1, 'a', True)
[0, 1, 2, 3, 4, 5] ['a', 'é', '🙂'] [97, 98]
[] () 0
before
display failed
False True
7
(1, 2, 'three', 4, 5, True)

module_environment

Source: corpus/module_environment.py · Run in the playground

__main__ None None A directly executed Python application.
main ran __main__
local __main__
first first second second second
first first first second
third third first builtins
third fourth local a local b third
default evaluation fourth 7

bitwise

Source: corpus/bitwise.py · Run in the playground

3 15 4
255 -241 -6 -4 -1 3
0 -1 0 -1
False True False True
1 5 -1 True False
1606938044258990275541962092341162602522202993782792835301377 -340282366920938463463374607431768211435 -1606938044258990275542302374708083540985666368390224603512812
0 1606938044258990275541962092341162602522202993782792835301393 -1
218456037562
True True
left
right
-133169404
True True
True False 1
False True False

integer_formatting

Source: corpus/integer_formatting.py · Run in the playground

0b0 0o0 0x0
0b1 0o1 0x1
-0b1 -0o1 -0x1
0b1000 0o10 0x8
0b11111111 0o377 0xff
0b100000000 0o400 0x100
-0b100000001 -0o401 -0x101
0b1 0o0 0x1
0b10000000000000000000000000000000000000000000000000000000000000001 0o2000000000000000000001 0x10000000000000001
18446744073709551617 18446744073709551617 18446744073709551617
0b101 0xff bin builtins
format argument
-0o11

shifts

Source: corpus/shifts.py · Run in the playground

1 256 -48 127 -128
2 0 -2 False
16 51422017416287688817342786954917203280710495801049370729644576 -17
0 0 0 -1
0 -1
OverflowError('too many digits in integer')
ValueError('negative shift count')
ValueError('negative shift count')
7
224 [128]
left
count
48

source_modules

Imports: scoreboard, report. Main file: corpus/source_modules/main.py.

d/Python score report
Scores: [18, 7, 24, 11]
Best: 24
Shared module: True
Function: record scoreboard

class_exports

Imports: models, other. Main file: corpus/class_exports/main.py.

model:7 other:9 model:5:child
True False True
Record models __main__
model:7 models other
True False True
True False
updated:7 other:9 updated:5:child

circular_modules

Imports: a, b. Main file: corpus/circular_modules/main.py.

['main', 'a start', 'b start', 'b end', 'a end']
[2, 3] True 2
True True True
42 42 __main__ None None
Circular import example.

source_packages

Imports: scoreboard, scoreboard.model, scoreboard.reports, scoreboard.reports.text. Main file: corpus/source_packages/main.py.

d/Python package example
Scores: [18, 7, 24, 11]; best: 24
scoreboard.model scoreboard.reports.text

callable_objects

Source: corpus/callable_objects/callable_objects.py · Run in the playground

Counter: 8 14 15
Sorted: [1, -1, 2, -3]
Extrema: 1 -3
Key calls: [-3, 1, -1, 2, -3, 1, -1, 2, -3, 1, -1, 2]
Callable: True True False

print_options

Source: corpus/print_options.py · Run in the playground

alpha / 42 / True!
λ<>🌍;
default spacing
!
left|right.
abes
None defaults
se
word:tail.
changed changed str
TypeError ae
TypeError es
empty call validates end
empty call validates sep
prefixchangedcaught conversion
afail
aliaschangedworks.
tuple/args.
closure·output.
None
direct-expanded-args.
True

utf8_encoding

Source: corpus/utf8_encoding.py · Run in the playground

b'caf\xc3\xa9 \xce\xbb \xf0\x9f\x8c\x8d\x00' 9 14 True False
True
True
True True
b'' b'ASCII' b'\x7f\xc2\x80\xdf\xbf\xe0\xa0\x80\xed\x9f\xbf\xee\x80\x80\xef\xbf\xbf\xf0\x90\x80\x80\xf4\x8f\xbf\xbf'
True True
b'\xce\xbb'
b'one / two / three'
b' \xce' [206, 187] 393
b'\xce\xbb' 1

bytes_indexing

Source: corpus/bytes_indexing.py · Run in the playground

32768
0 48
1 49
2 0
3 128
4 255
32766 98
32767 99
-1 99
-2 98
-32768 48
48 49
IndexError index out of range
IndexError index out of range
IndexError cannot fit 'int' into an index-sized integer
IndexError cannot fit 'int' into an index-sized integer
111 b'new' 1
empty bytes

divmod

Source: corpus/divmod.py · Run in the playground

7 3 (2, 1)
-7 3 (-3, 2)
7 -3 (-3, -2)
-7 -3 (2, -1)
0 -3 (0, 0)
42 7 (6, 0)
(158456325028528675187087900672, 3)
(-158456325028528675187087900673, 5)
(-158456325028528675187087900673, -5)
(0, 0) (1, 0) (0, 1)
(3, 2) ['left', 'right']
first ['first']
second ['first', 'second']
['numerator', 'zero']
(3, 2) 99
(-4, 4) -4 4 True True
(5, 4)
ZeroDivisionError integer division or modulo by zero
ZeroDivisionError integer division or modulo by zero

ascii

Source: corpus/ascii.py · Run in the playground

'caf\xe9 \u6771\u4eac \U0001f600 \' " \\ \n \x00'
<'caf\xe9 \u6771\u4eac \U0001f600 \' " \\ \n \x00'>
b'\x00\x7f\x80\xff\'"'
(1, True, None, '\xe9')
[['\xe9', '\U0001f600'], ['\u96ea']]
{'\xe9': '\U0001f600', '\u96ea': '\u4e2d'}
{'\xe9'} frozenset({'\U0001f600'})
range(-2, 7, 2)
123456789012345678901234567890 False None
ValueError('\xe9\n\U0001f600')
<\xe9> ['make:é', 'é']
<\u03b1>|<\U0001f600> ['make:α', 'α', 'make:😀', '😀']
[<\u6771\u4eac>, <\xe9>] ['東京', 'é']
'\x00\t\n\r\\\'"\x7f\\xe9\\xff\\u0100\\u96ea\\U0001f600\\U0010ffff'
'\x00\t\n\r\\\'"\x7f\\xe9\\xff\\u0100\\u96ea\\U0001f600\\U0010ffff'
'\xe9' '\u96ea'
repr failed
repr failed
__repr__ returned non-string (type int)

reversed

Source: corpus/reversed.py · Run in the playground

[3, 2, 1]
[True, False, True]
['\x00', '😀', '雪', 'é', 'A']
[255, 128, 127, 0]
[] [] [] []
[11, 8, 5, 2] [0, 3, 6, 9]
[(10, '😀'), (11, 'é')]
[(3, 'c'), (2, 'b'), (1, 'a')]
[6, 4, 2]
list_reverseiterator reversed
reversed reversed
True
2
10
99 -1
-1 [99, 0, 10, 2, 3, 4]
-1
-1
[40, 20, 10]
[9, 8, 7] [100]
['é', 'd', 'l', 'o'] new
[] [1]
[4, 3] 1
[6, 5]
1
stopped
-1
list_reverseiterator
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999998 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999992
-9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999990 -9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999985

ord

Source: corpus/ord.py · Run in the playground

65 0 233 955 8364 127757
65 0 128 255
127 128 2047 2048
55295 57344 65535 65536 1114111
955 ['character']
ValueError source failed ['failed']
233 127757
8364 255
True False
TypeError ord() expected a character, but string of length 0 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected a character, but string of length 0 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected a character, but string of length 2 found
TypeError ord() expected string of length 1, but int found ['wrong']
TypeError ord() expected string of length 1, but Character found []

chr

Source: corpus/chr.py · Run in the playground

0 '\x00' b'\x00' 0
1 '\x01' b'\x01' 1
65 'A' b'A' 65
127 '\x7f' b'\x7f' 127
128 '\x80' b'\xc2\x80' 128
233 '\xe9' b'\xc3\xa9' 233
955 '\u03bb' b'\xce\xbb' 955
2047 '\u07ff' b'\xdf\xbf' 2047
2048 '\u0800' b'\xe0\xa0\x80' 2048
8364 '\u20ac' b'\xe2\x82\xac' 8364
55295 '\ud7ff' b'\xed\x9f\xbf' 55295
57344 '\ue000' b'\xee\x80\x80' 57344
65535 '\uffff' b'\xef\xbf\xbf' 65535
65536 '\U00010000' b'\xf0\x90\x80\x80' 65536
127757 '\U0001f30d' b'\xf0\x9f\x8c\x8d' 127757
1114111 '\U0010ffff' b'\xf4\x8f\xbf\xbf' 1114111
'\x00' '\x01' True
λ ['point']
ValueError source failed ['failed']
é 🌍
€ '\x00'
OverflowError Python int too large to convert to C int
ValueError chr() arg not in range(0x110000)
ValueError chr() arg not in range(0x110000)
ValueError chr() arg not in range(0x110000)
ValueError chr() arg not in range(0x110000)
OverflowError Python int too large to convert to C int
OverflowError Python int too large to convert to C int
OverflowError Python int too large to convert to C int
TypeError an integer is required (got type str) ['wrong']
TypeError an integer is required (got type Point) []

list_sort

Source: corpus/list_sort.py · Run in the playground

None [-9, -2, 0, 1, 3, 3] True [-9, -2, 0, 1, 3, 3]
None [3, 3, 1, 0, -2, -9]
None [0, 1, -2, 3, 3, -9]
None [-9, 3, 3, -2, 1, 0]
None []
None [7]
None [False, False, True, True]
None ['a', 'é', '雪', '😀']
None [b'\xff', b'a', b'a', b'\x00']
None [('a', 1), ('d', 1), ('b', 2), ('c', 2)]
None [('b', 2), ('c', 2), ('a', 1), ('d', 1)]
None
['b', 'a', 'c'] True
None [3, 2, 1]
None [3, 2, 1] ['receiver', 'reverse expression', 'key expression', '3:0', '1:0', '2:0']
observe None [3, 2, 1] True [0, 0, 0] [3, 1, 2]
append list modified during sort [3, 2, 1] True [0, 1, 2] [3, 1, 2]
append-pop list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
append-remove list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
append-clear list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
insert-clear list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
extend-clear list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
clear None [3, 2, 1] True [0, 0, 0] [3, 1, 2]
reverse None [3, 2, 1] True [0, 0, 0] [3, 1, 2]
empty-extend None [3, 2, 1] True [0, 0, 0] [3, 1, 2]
nested None [3, 2, 1] True [0, 0, 0] [3, 1, 2]
append-nested-clear list modified during sort [3, 2, 1] True [0, 0, 0] [3, 1, 2]
fail key stopped [3, 1, 2] True [0, 0] [3, 1]
append-fail key stopped [3, 1, 2] True [0, 1] [3, 1]
OverflowError Python int too large to convert to C int [2, 1]

generator_expressions

Source: corpus/generator_expressions.py · Run in the playground

generator ['source']
True 10 ['source', 'keep:1', 'element:1']
30 ['source', 'keep:1', 'element:1', 'keep:2', 'keep:3', 'element:3']
[] -1 ['source', 'keep:1', 'element:1', 'keep:2', 'keep:3', 'element:3', 'keep:4']
[9, 1, 4]
['a', 'é', '雪', '😀']
[0, 128, 255]
[3, 2, 1]
[(7, 'a'), (8, 'b')]
[11, 22]
10
True True
[None, None]
[]
10 [99] [1, 2, 3]
[40, 60]
[10, 11, 12]
1
[51, 52]
2 2 999
3 3 3 999
0 0
2 [2, 2, 2]
[4] [5, 5, 5, 5, 5, 5]
[12] [12]
0 [13]
0 1
ValueError element failed [0, 1, 2]
[] -1 [0, 1, 2]
RuntimeError generator raised StopIteration
[]
RuntimeError generator raised StopIteration
[]

filter

Source: corpus/filter.py · Run in the playground

[1, -2, 3]
['é', '雪', '😀']
[1, 128, 255]
[True, True]
[-2, 1, 4, 7]
[4, 2]
[[1], [2, 3]]
filter True True []
1 [0, 1]
3 [0, 1, 2, 3]
[5] -1 [0, 1, 2, 3, 5]
True type filter builtins
True True False
True True True
type bool builtins
True True True
[7, 9] False True
[4, 6]
1
True predicate failed
3 -1
1
True predicate stopped
[3, 4]
[1] [3, 4]
[] 1
[] 3

iterator_protocols

Source: corpus/iterator_protocols.py · Run in the playground

True Cursor True 1
0 1 [2, 3] 2 5
-1 -1 7
[3, 6, 9]
10 3 6
True False True
[4, 3, 2, 1]
[1, 3, 5]
[(10, 2), (11, 3), (12, 4)]
[(1, 6), (2, 7)]
['a', 'é', '雪', '😀'] 1
['a', 'é', '雪', '😀'] 2
True True 4
11 [12, 13]

context_managers

Source: corpus/context_managers.py · Run in the playground

outer inner
True False False
True False False
['enter outer', 'enter inner', 'exit inner None', 'exit outer None']
False True False
continued ['enter suppress', 'exit suppress original']
False True False
False True False
True original
['enter outer', 'enter inner', 'exit inner original', 'exit outer original']
True False False
True False False
True False False
True False False
True False False
True False False
1 9
['enter function', 'enter 0', 'exit 0 None', 'enter 1', 'exit 1 None', 'exit function None', 'enter function', 'enter 0', 'exit 0 None', 'enter 1', 'exit 1 None', 'exit function None']

index_protocols

Source: corpus/index_protocols.py · Run in the playground

0b1110111011 0o1673 0x3bb λ [955, 955, 955, 955]
-0xff
🌍 [-255, 127757]
-2147483649 OverflowError Python int too large to convert to C int
-2147483648 ValueError chr() arg not in range(0x110000)
-1 ValueError chr() arg not in range(0x110000)
0 '\x00'
1114111 '\U0010ffff'
1114112 ValueError chr() arg not in range(0x110000)
2147483647 ValueError chr() arg not in range(0x110000)
2147483648 OverflowError Python int too large to convert to C int
[-2147483649, -2147483648, -1, 0, 1114111, 1114112, 2147483647, 2147483648]
TypeError __index__ returned non-int (type str)
TypeError 'Missing' object cannot be interpreted as an integer

generator_clauses

Source: corpus/generator_clauses.py · Run in the playground

generator ['outer']
True 11 ['outer', 'keep:1', 'inner:1', 'keep:1', 'element:1:1']
33 ['outer', 'keep:1', 'inner:1', 'keep:1', 'element:1:1', 'keep:2', 'keep:2', 'keep:3', 'inner:3', 'keep:3', 'element:3:3']
[] -1 ['outer', 'keep:1', 'inner:1', 'keep:1', 'element:1:1', 'keep:2', 'keep:2', 'keep:3', 'inner:3', 'keep:3', 'element:3:3', 'keep:4']
[20, 21, 120, 121]
['é😀', 'éa', '雪😀', '雪a']
[1, 2, 256, 257]
[]
[None, None, None, None]
18
False
True
[-1, 0, 0, 1, 1, 2]
[(0, 0), (1, 1), (2, 1), (3, 2)]
[1, 1, 2]

input_calls

Source: corpus/input_calls.py · Run in the playground

What the test typed in answer to input() (shown escaped):

"\n  spaces \u0000 é😀  \nnone\nbytes\r\r\ninteger\rinside\nboolean\nlast"
''
text>'  spaces \x00 é😀  '
None'none'
b'bytes>''bytes\r\r'
123'integer\rinside'
True'boolean'
'last'
eof>EOFError EOF when reading a line

map

Source: corpus/map.py · Run in the playground

[3, 0, 4]
[6, 17]
[97, 233, 38634, 128512]
True
[1, 128, 256]
[1, 2, 0]
True map True
10 -1 -1 3
[]
0
True callback stop
4 -1

pow

Source: corpus/pow.py · Run in the playground

2147483648 -243 1
1 0 3
7 -12
19 -62
2187 -343
-10 -21
0 0
0 0
ValueError pow() 3rd argument cannot be 0
ZeroDivisionError 0.0 cannot be raised to a negative power