mailr15196 - /branches/spec_api/arg_check.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on January 19, 2012 - 13:58:
Author: bugman
Date: Thu Jan 19 13:58:04 2012
New Revision: 15196

URL: http://svn.gna.org/viewcvs/relax?rev=15196&view=rev
Log:
Updated the arg_check.is_func() function for handling class methods.


Modified:
    branches/spec_api/arg_check.py

Modified: branches/spec_api/arg_check.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/arg_check.py?rev=15196&r1=15195&r2=15196&view=diff
==============================================================================
--- branches/spec_api/arg_check.py (original)
+++ branches/spec_api/arg_check.py Thu Jan 19 13:58:04 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2009-2011 Edward d'Auvergne                                  
 #
+# Copyright (C) 2009-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -29,7 +29,7 @@
 # relax module imports.
 from relax_errors import RelaxBoolError, RelaxFloatError, 
RelaxFunctionError, RelaxIntError, RelaxIntListIntError,RelaxListFloatError, 
RelaxListIntError, RelaxMatrixFloatError, RelaxNoneFloatError, 
RelaxNoneFunctionError, RelaxListNumError, RelaxListStrError, RelaxNoneError, 
RelaxNoneIntError, RelaxNoneIntListIntError, RelaxNoneListFloatError, 
RelaxNoneListIntError, RelaxNoneMatrixFloatError, RelaxNoneListNumError, 
RelaxNoneListStrError, RelaxNoneNumError, RelaxNoneNumStrListNumStrError, 
RelaxNoneNumTupleNumError, RelaxNoneStrError, RelaxNoneStrFileError, 
RelaxNoneStrListNumError, RelaxNoneStrListStrError, RelaxNumError, 
RelaxNumStrListNumStrError, RelaxNumTupleNumError, RelaxStrError, 
RelaxStrFileError, RelaxStrListNumError, RelaxStrListStrError, 
RelaxTupleError, RelaxTupleNumError
 from relax_io import DummyFileObject
-from types import FunctionType
+from types import FunctionType, MethodType
 
 
 def is_bool(arg, name):
@@ -207,7 +207,7 @@
         return
 
     # Check for a function.
-    if isinstance(arg, FunctionType):
+    if isinstance(arg, FunctionType) or isinstance(arg, MethodType):
         return
 
     # Fail.




Related Messages


Powered by MHonArc, Updated Thu Jan 19 18:20:02 2012