Newbie question: Returning mutable vs. immutable

pugnatio2 at yahoo.com pugnatio2 at yahoo.com
Thu Apr 15 10:27:03 EDT 2004


Hi, Does anyone have an opinion as to whether functions/methods should
return mutable or immutable objects? In some circumstances, I could
see that mutable objects might be more convenient, but if the function
is to be reused, it might be a good idea to return only immutables.

Or is this question moot, since the function returns control to the
caller and is out of the picture at that point?

Thanks,

--p



More information about the Python-list mailing list