I am new to Python, with some experience in Java, C++ and R.

Writing in other languages I usually check the type and values of function 
arguments. In the Python code examples I have seen this is rarely done. 

Questions:

1) Is this because it would be "unpythonic" or just because the examples are 
not really production code?

2) If I still want to check the type of my arguments, do I

a) use type() or is instance() to check for type?

b) use assert (I guess not), raise a ValueError, or sys.exit()? 

(I noticed that raising a ValueError does not stop execution when I am running 
the Interactive Interpreter under PTVS, which I find inconvenient, but it does 
stop execution when running the code non-interactively.)

Thanks.

FS
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to