mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
78 lines
1.5 KiB
Plaintext
78 lines
1.5 KiB
Plaintext
hello world!
|
|
successfully errored with this message:
|
|
Traceback (most recent call last):
|
|
NameError: nonexistatn
|
|
|
|
testing int methods
|
|
11
|
|
11
|
|
|
|
testing float methods
|
|
11.11
|
|
11.110000
|
|
|
|
testing bool methods
|
|
False
|
|
0
|
|
|
|
testing string methods
|
|
hello!
|
|
hello
|
|
hello
|
|
|
|
testing None methods
|
|
None
|
|
|
|
testing voidp methods
|
|
<void* at 0x7b>
|
|
123
|
|
|
|
testing sizing and indexing
|
|
stack size 6
|
|
|
|
testing error catching
|
|
successfully errored with this message:
|
|
File "<c-bound>", line 1
|
|
let's make sure syntax errors get caught
|
|
SyntaxError: EOL while scanning string literal
|
|
|
|
testing calls
|
|
x : -1
|
|
vararg_x : 21
|
|
keyword_x : 4
|
|
keyword_x : 2
|
|
retmany_x : 1
|
|
retmany_x : 2
|
|
retmany_x : 3
|
|
successfully errored with this message:
|
|
TypeError: expected 2 positional arguments, got 0 (x)
|
|
['hello']
|
|
|
|
testing pushing functions
|
|
12
|
|
successfully errored with this message:
|
|
Traceback (most recent call last):
|
|
File "<c-bound>", line 1
|
|
test_error_propagate()
|
|
NameError: catch me
|
|
successfully errored with this message:
|
|
Traceback (most recent call last):
|
|
File "<c-bound>", line 1
|
|
raise NameError('testing error throwing from python')
|
|
NameError: testing error throwing from python
|
|
successfully errored with this message:
|
|
Traceback (most recent call last):
|
|
_: test direct error mechanism
|
|
successfully errored with this message:
|
|
Traceback (most recent call last):
|
|
File "<c-bound>", line 1
|
|
test_nested_error()
|
|
File "<c-bound>", line 1
|
|
def error_from_python() : raise NotImplementedError()
|
|
NotImplementedError
|
|
pi: 3.14
|
|
pi: 3.14
|
|
2
|
|
successfully errored with this message:
|
|
TypeError: expected 'int', got 'float'
|