Hi

Trying to clarify why ints and strings arent treated the same.

You can get a valuerror from trying to cast a non-int to an int as in int(3.0) 
however you cannot do a non string with str(a).

Which means that you likely should use try and except to test if a user enters 
a non-int with valuerror. 
However as you can't str () and get a valuerror you use conditional logic with 
strings.

Therefore to try and keep with pythons only one obvious way of doing things 
should i prefer conditional logic for all using isinstance?

That way regardless of input type my code flows the same and more explicitly 
states the intended type.
Sayth
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to