does lack of type declarations make Python unsafe?

martin z pxtl at hotmail.com
Sun Jun 15 17:55:32 EDT 2003


> You *can* test the types of the arguments yourself, inside
> the function. But this is regarded bad practice amongst Python
> programmers, for the above mentioned reasons.

On this subject, is there a way to test not the specific type, or simply the
protocol an object supports?  String, int, etc.  I want to make a function
do one thing with a numeric-type object and a different thing with a
string-type object.






More information about the Python-list mailing list