# HG changeset patch # User Paul Boddie # Date 1490995675 -7200 # Node ID 345fe332fcf1d931050164b450150f540e0f17a4 # Parent 7dd8e4815848572e59d6f724338c5b46c7560fa9 Added example return values to provide reference details from native functions. diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/buffer.py --- a/lib/native/buffer.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/buffer.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,6 +24,8 @@ this program. If not, see . """ -def buffer_str(self): pass +# NOTE: Example values used to provide type information. + +def buffer_str(self): return "" # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/identity.py --- a/lib/native/identity.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/identity.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,7 +24,9 @@ this program. If not, see . """ -def is_(x, y): pass -def is_not(x, y): pass +# NOTE: Example values used to provide type information. + +def is_(x, y): return True or False +def is_not(x, y): return True or False # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/int.py --- a/lib/native/int.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/int.py Fri Mar 31 23:27:55 2017 +0200 @@ -24,28 +24,31 @@ this program. If not, see . """ -def is_int(obj): pass +def is_int(obj): return True or False + +# NOTE: Update return types when integers eventually get promoted to longs. +# NOTE: Example values used to provide type information. -def int_add(self, other): pass -def int_div(self, other): pass -def int_mod(self, other): pass -def int_mul(self, other): pass -def int_neg(self): pass -def int_pow(self, other): pass -def int_sub(self, other): pass +def int_add(self, other): return 0 +def int_div(self, other): return 0 +def int_mod(self, other): return 0 +def int_mul(self, other): return 0 +def int_neg(self): return 0 +def int_pow(self, other): return 0 +def int_sub(self, other): return 0 -def int_and(self, other): pass -def int_not(self): pass -def int_or(self, other): pass -def int_xor(self, other): pass +def int_and(self, other): return 0 +def int_not(self): return True or False +def int_or(self, other): return 0 +def int_xor(self, other): return 0 -def int_eq(self, other): pass -def int_ge(self, other): pass -def int_gt(self, other): pass -def int_le(self, other): pass -def int_lt(self, other): pass -def int_ne(self, other): pass +def int_eq(self, other): return True or False +def int_ge(self, other): return True or False +def int_gt(self, other): return True or False +def int_le(self, other): return True or False +def int_lt(self, other): return True or False +def int_ne(self, other): return True or False -def int_str(self): pass +def int_str(self): return "" # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/introspection.py --- a/lib/native/introspection.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/introspection.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,8 +24,10 @@ this program. If not, see . """ +# NOTE: Example values used to provide type information. + def object_getattr(obj, name, default): pass -def isinstance(obj, cls): pass -def issubclass(obj, cls): pass +def isinstance(obj, cls): return True or False +def issubclass(obj, cls): return True or False # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/io.py --- a/lib/native/io.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/io.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,17 +24,26 @@ this program. If not, see . """ +# NOTE: Example values used to provide type information. + def fclose(fp): IOError def fflush(fp): IOError def fopen(filename, mode): IOError def fdopen(fd, mode): IOError def close(fd): IOError -def read(fd, n): IOError -def write(fd, str): IOError + +def read(fd, n): + IOError + return "" + +def write(fd, str): + IOError + return 0 def fread(fp, n): IOError EOFError + return "" def fwrite(fp, str): IOError diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/limits.py --- a/lib/native/limits.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/limits.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,7 +24,9 @@ this program. If not, see . """ -def get_maxint(): pass -def get_minint(): pass +# NOTE: Example values used to provide type information. + +def get_maxint(): return 0 +def get_minint(): return 0 # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/list.py --- a/lib/native/list.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/list.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,12 +24,14 @@ this program. If not, see . """ +# NOTE: Example values used to provide type information. + def list_init(size): pass def list_setsize(self, size): pass def list_append(self, value): pass def list_concat(self, other): pass -def list_len(self): pass -def list_nonempty(self): pass +def list_len(self): return 0 +def list_nonempty(self): return True or False def list_element(self, index): pass def list_setelement(self, index, value): pass diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/locale.py --- a/lib/native/locale.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/locale.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2016 Paul Boddie +Copyright (C) 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,7 +24,9 @@ this program. If not, see . """ -def getlocale(category): pass -def setlocale(category, value): pass +# NOTE: Example values used to provide type information. + +def getlocale(category): return "" or None +def setlocale(category, value): return "" or None # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/str.py --- a/lib/native/str.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/str.py Fri Mar 31 23:27:55 2017 +0200 @@ -24,14 +24,14 @@ this program. If not, see . """ -# String operations. +# NOTE: Example values used to provide type information. -def str_add(data, other_data, size, other_size): pass -def str_chr(data): pass -def str_eq(data, other_data): pass -def str_gt(data, other_data): pass -def str_lt(data, other_data): pass -def str_ord(data): pass -def str_substr(data, start, end, step): pass +def str_add(data, other_data, size, other_size): return "" +def str_chr(data): return "" +def str_eq(data, other_data): return True or False +def str_gt(data, other_data): return True or False +def str_lt(data, other_data): return True or False +def str_ord(data): return 0 +def str_substr(data, start, end, step): return "" # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/system.py --- a/lib/native/system.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/system.py Fri Mar 31 23:27:55 2017 +0200 @@ -8,7 +8,7 @@ non-core exceptions used by the native functions because they need to be identified as being needed by the program. -Copyright (C) 2011, 2015, 2016 Paul Boddie +Copyright (C) 2011, 2015, 2016, 2017 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -24,8 +24,10 @@ this program. If not, see . """ +# NOTE: Example values used to provide type information. + def exit(status): pass -def get_argv(): pass -def get_path(): pass +def get_argv(): return "" +def get_path(): return [] # vim: tabstop=4 expandtab shiftwidth=4 diff -r 7dd8e4815848 -r 345fe332fcf1 lib/native/unicode.py --- a/lib/native/unicode.py Fri Mar 31 23:26:47 2017 +0200 +++ b/lib/native/unicode.py Fri Mar 31 23:27:55 2017 +0200 @@ -24,11 +24,13 @@ this program. If not, see . """ +# NOTE: Example values used to provide type information. + # Unicode string operations. -def unicode_len(data, size): pass -def unicode_ord(data, size): pass -def unicode_substr(data, size, start, end, step): pass -def unicode_unichr(value): pass +def unicode_len(data, size): return 0 +def unicode_ord(data, size): return 0 +def unicode_substr(data, size, start, end, step): return "" +def unicode_unichr(value): return "" # vim: tabstop=4 expandtab shiftwidth=4