2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-30 20:12:37 +00:00
Files
python/example/tst_passing_char.py
Ralf W. Grosse-Kunstleve f1d4a38121 Added to/from_python converters for [plain] char.
Reverted to original converters for un/signed char.


[SVN r9046]
2001-02-09 03:31:32 +00:00

21 lines
568 B
Python

import passing_char
print passing_char.get_char()
print passing_char.get_signed_char()
print passing_char.get_unsigned_char()
for arg in (-97, 97, -140, 140, "a", "ab"):
try:
print 'char', arg, ':'
passing_char.use_char(arg)
except (TypeError, ValueError), e:
print e.args[0]
try:
print 'signed char', arg, ':'
passing_char.use_signed_char(arg)
except (TypeError, ValueError), e:
print e.args[0]
try:
print 'unsigned char', arg, ':'
passing_char.use_unsigned_char(arg)
except (TypeError, ValueError), e:
print e.args[0]