# HG changeset patch # User Paul Boddie # Date 1339537938 -7200 # Node ID 7e2bd174ae7351c143670c53ab9a682370bd326f # Parent e7eab0edc22594eb85e8f3b6791c67e99e40248a Added placeholder modules for _weakref and math. Added a test of math function imports. diff -r e7eab0edc225 -r 7e2bd174ae73 lib/_weakref.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/_weakref.py Tue Jun 12 23:52:18 2012 +0200 @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +""" +Weak references. + +Copyright (C) 2012 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 +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +""" + +class ref: + pass + +def getweakrefcount(obj): pass +def getweakrefs(obj): pass +def proxy(obj, callback=None): pass + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r e7eab0edc225 -r 7e2bd174ae73 lib/math.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/math.py Tue Jun 12 23:52:18 2012 +0200 @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +""" +Mathematical functions. + +Copyright (C) 2012 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 +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . +""" + +def pow(x, y): + + "Return x ** y." + + return x ** y + +def acos(x): pass +def asin(x): pass +def atan(x): pass +def atan2(y, x): pass +def ceil(x): pass +def cos(x): pass +def cosh(x): pass +def degrees(x): pass +def exp(x): pass +def fabs(x): pass +def floor(x): pass +def fmod(x, y): pass +def frexp(x): pass +def hypot(x, y): pass +def ldexp(x, i): pass +def log(x, base=None): pass +def log10(x): pass +def modf(x): pass +def radians(x): pass +def sin(x): pass +def sinh(x): pass +def sqrt(x): pass +def tan(x): pass +def tanh(x): pass + +# NOTE: To be defined: e, pi. + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r e7eab0edc225 -r 7e2bd174ae73 tests/maths.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/maths.py Tue Jun 12 23:52:18 2012 +0200 @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +from math import pow + +result1_1 = pow(2, 0) +result2_1 = pow(1, 1) +result3_1 = pow(1, 10) + +# vim: tabstop=4 expandtab shiftwidth=4