Simulating call of instance like a list or tuple
justin at iago.org
Mon Jan 14 17:13:04 CET 2002
Brett Cannon <bac at OCF.Berkeley.EDU> writes:
> It seems everyone is thinking that I want __repr__ or __str__, which is in
> the right vein, but not quite it. I want the same functionality, but I
> want to be able to return something other than a string. I don't think it
> exists outside of the built-in classes.
What behavior do you think that the builtins have?
>From your first post, it really sounded like you wanted __repr__.
Describe precisely what you want and perhaps people will have a better
understanding of how to help. I suspect that your question really
has already been answered, though.
More information about the Python-list