OILS / asdl / target_lang_test.py View on Github | oilshell.org

38 lines, 12 significant
1#!/usr/bin/env python2
2"""target_lang_test.py: test out MyPy-compatible code we generated
3
4Similar to mycpp/demo/target_lang.cc
5"""
6
7#import collections
8#import unittest
9
10from typing import List
11
12
13class word_t(object):
14 pass
15
16#class CompoundWord('List[int]'):
17#class CompoundWord(word_t, 'List[int]'):
18
19#class CompoundWord(List[int]):
20class CompoundWord(word_t, List[int]):
21 pass
22
23
24def main():
25 # type: () -> None
26
27 #print(dir(collections))
28
29 # Wow this works
30 c = CompoundWord()
31
32 c.append(42)
33 print(c)
34 print('len %d' % len(c))
35
36
37if __name__ == '__main__':
38 main()