polymorphism w/out signatures?

pugnatio2 at yahoo.com pugnatio2 at yahoo.com
Thu May 6 15:28:53 EDT 2004


What's the standard way to implement polymorphic behavior in a python
method, given that method arguments can't declare their types as
they're being passed in, and method definitions don't have signatures?

For instance, if I wanted to write a method that auto-detected whether
it was being passed a string or a tuple/list, how would I do so
without using type() to identify the parameter's type? Using type() is
deprecated in the documentation I've read.

Thanks in advance.



More information about the Python-list mailing list