Joel Hedlund a écrit : > Hi! > > The question of type checking/enforcing has bothered me for a while, (snip) > > I've also whipped up some examples in order to put the above questions > in context and for your amusement. :-) (snip) > These are the attached modules: > > * nocheck_module.py: > As the above example, but with docs. No type checking. > > * property_module.py > Type checking of data members using properties. > > * methodcheck_module.py > Type checking of args within methods. > > * decorator_module.py > Type checking of args using method decorators. > > * maximum_security_module.py > Decorator and property type checking.
You forgot two other possible solutions (that can be mixed): - using custom descriptors - using FormEncode -- http://mail.python.org/mailman/listinfo/python-list