1 | #!/usr/bin/env python2
|
2 | """target_lang_test.py: test out MyPy-compatible code we generated
|
3 |
|
4 | Similar to mycpp/demo/target_lang.cc
|
5 | """
|
6 |
|
7 | #import collections
|
8 | #import unittest
|
9 |
|
10 | from typing import List
|
11 |
|
12 |
|
13 | class word_t(object):
|
14 | pass
|
15 |
|
16 | #class CompoundWord('List[int]'):
|
17 | #class CompoundWord(word_t, 'List[int]'):
|
18 |
|
19 | #class CompoundWord(List[int]):
|
20 | class CompoundWord(word_t, List[int]):
|
21 | pass
|
22 |
|
23 |
|
24 | def 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 |
|
37 | if __name__ == '__main__':
|
38 | main()
|