From: <pj...@us...> - 2008-04-07 19:47:49
|
Revision: 4316 http://jython.svn.sourceforge.net/jython/?rev=4316&view=rev Author: pjenvey Date: 2008-04-07 12:47:42 -0700 (Mon, 07 Apr 2008) Log Message: ----------- expose __module__ on builtin functions. gives pickle less work to do when saving them Modified Paths: -------------- trunk/jython/src/org/python/core/PyBuiltinFunction.java trunk/jython/src/org/python/core/__builtin__.java Modified: trunk/jython/src/org/python/core/PyBuiltinFunction.java =================================================================== --- trunk/jython/src/org/python/core/PyBuiltinFunction.java 2008-04-07 05:27:02 UTC (rev 4315) +++ trunk/jython/src/org/python/core/PyBuiltinFunction.java 2008-04-07 19:47:42 UTC (rev 4316) @@ -32,6 +32,11 @@ return Py.None; } + @ExposedGet(name = "__module__") + public PyObject getModule() { + return Py.None; + } + @ExposedGet(name = "__call__") public PyObject makeCall() { return this; Modified: trunk/jython/src/org/python/core/__builtin__.java =================================================================== --- trunk/jython/src/org/python/core/__builtin__.java 2008-04-07 05:27:02 UTC (rev 4315) +++ trunk/jython/src/org/python/core/__builtin__.java 2008-04-07 19:47:42 UTC (rev 4316) @@ -13,6 +13,8 @@ class BuiltinFunctions extends PyBuiltinFunctionSet { + public static final PyObject module = Py.newString("__builtin__"); + public BuiltinFunctions(String name, int index, int argcount) { this(name, index, argcount, argcount); } @@ -293,6 +295,10 @@ throw info.unexpectedCall(args.length, false); } } + + public PyObject getModule() { + return module; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |