Simulating call of instance like a list or tuple

Justin Sheehy justin at iago.org
Mon Jan 14 11:13:04 EST 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.

-Justin

 





More information about the Python-list mailing list