Message194251
What's wrong with:
if not isinstance(data, basestring):
raise TypeError(...)
?
In any case, you appear to be wanting to use assert to check user input. That's not its intended use; instead, it's there for making debugging assertions. Bear in mind that when running in optimized mode (with python -O), Python won't execute those asserts at all. (See http://docs.python.org/3.4/reference/simple_stmts.html#the-assert-statement for more.)
I think this should be rejected. |
|
Date |
User |
Action |
Args |
2013-08-03 12:07:10 | mark.dickinson | set | recipients:
+ mark.dickinson, WitcherGeralt |
2013-08-03 12:07:10 | mark.dickinson | set | messageid: <1375531630.05.0.324846148411.issue18642@psf.upfronthosting.co.za> |
2013-08-03 12:07:10 | mark.dickinson | link | issue18642 messages |
2013-08-03 12:07:09 | mark.dickinson | create | |
|