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

31 lines, 19 significant
1#!/usr/bin/env python2
2"""
3invalid_too_many_defaults.py
4"""
5from __future__ import print_function
6
7from typing import List, Dict
8
9s = ''
10mylist = [] # type: List[int]
11d = {} # type: Dict[int, int]
12
13if s:
14 print('string')
15
16if mylist:
17 print('List')
18
19if d:
20 print('Dict')
21
22b = True if s else False
23b = True if mylist else False
24b = True if d else False
25
26if not mylist:
27 print('List')
28
29other_list = [] # type: List[str]
30if not mylist and not other_list:
31 print('List')