OILS / mycpp / examples / invalid_format_strings.py View on Github | oilshell.org

20 lines, 4 significant
1#!/usr/bin/env python2
2"""
3invalid_format_strings.py
4"""
5from __future__ import print_function
6
7
8def run_tests():
9 # type: () -> None
10
11 x = 33
12
13 print('x = %z' % x)
14
15 # TODO: this doesn't fail at translate time
16
17 # With StrFormat(), it will make it to C++ runtime, past C++ compile time
18 #print('x = %x' % x)
19
20 # Similarly for '%-2d' I believe