OILS / mycpp / examples / invalid_format_args.py View on Github | oils.pub

18 lines, 5 significant
1#!/usr/bin/env python2
2"""
3invalid_format_args.py
4"""
5from __future__ import print_function
6
7
8def run_tests():
9 # type: () -> None
10
11 # MyPy catches this: too many args
12 s = '%s %%' % ('x', 42)
13
14 # MyPy catches this: %c requires int or char
15 s = '%c' % 'xx'
16
17 # Too few args
18 s = '%s %d' % 'x'