Update of /cvsroot/sqlobject/SQLObject/SQLObject
In directory sc8-pr-cvs1:/tmp/cvs-serv21770/SQLObject
Modified Files:
SQLObject.py
Log Message:
Added a warning for when a method shadows a column name (which
leads to weird bugs)
Index: SQLObject.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/SQLObject.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** SQLObject.py 6 May 2003 22:43:35 -0000 1.33
--- SQLObject.py 10 May 2003 21:37:18 -0000 1.34
***************
*** 26,29 ****
--- 26,31 ----
import Col
import Style
+ import types
+ import warnings
import sys
***************
*** 237,240 ****
--- 239,245 ----
continue
if d.has_key(var):
+ if isinstance(d[var], types.MethodType) \
+ or isinstance(d[var], types.FunctionType):
+ warnings.warn("""I tried to set the property "%s", but it was already set, as a method. Methods have significantly different semantics than properties, and this may be a sign of a bug in your code.""" % var)
continue
setFunc(var,
|