comparison numerics/convert.py @ 27:f865bc916593

stub for type inference
author Jeff Hammel <k0scist@gmail.com>
date Tue, 07 Oct 2014 21:04:36 -0700
parents 7761aa18e885
children a655306ee78d
comparison
equal deleted inserted replaced
26:e01d84d29cd0 27:f865bc916593
1 #!/usr/bin/env python
2
3 """
4 convert between types
5 """
6
7 import sys
8 from .read import CSVParser
9
1 __all__ = ['cast', 'float_or_orig'] 10 __all__ = ['cast', 'float_or_orig']
2 11
3 def cast(to_type, *values): 12 def cast(to_type, *values):
4 retval = [] 13 retval = []
5 for value in values: 14 for value in values:
9 retval.append(value) 18 retval.append(value)
10 return retval 19 return retval
11 20
12 def float_or_orig(*values): 21 def float_or_orig(*values):
13 return cast(float, *values) 22 return cast(float, *values)
23
24 def main(args=sys.argv[1:]):
25 """CLI"""
26
27 if __name__ == '__main__':
28 main()