Python's idiom for function overloads
Frans Englich
frans.englich at telia.com
Tue Feb 1 14:53:13 EST 2005
On Tuesday 01 February 2005 05:02, Steven Bethard wrote:
> Frans Englich wrote:
> > But in Python, when one wants to be able to pass different data types
> > into a single "entry point" for functionality, how is that best done? To
> > in a function do an if statement with the type() function?
>
> It often depends a lot on the specific use case... Do you have a
> particular example in mind?
I did have a specific scenario, but it blurred into a general wondering about
typing. I think my problem was, and still is, that I don't think in Python
terms but try to force other idioms. Thinking in static typic terms when
Python goes in the opposite direction clearly shows friction is created.
The replies were interesting,
Frans
More information about the Python-list
mailing list