
If the return value is an instance of a class, then to extend the return value you just add a new instance attribute to the class. If a class feels too heavy duty, use a single named tuple and access its elements with dot notation. Either method is guaranteed not to break until you remove an instance attribute or element, at which point it doesn't make sense to do anything else. On Thu, Jan 13, 2011 at 10:33 AM, Eric Smith <eric@trueblade.com> wrote:
On 01/13/2011 10:21 AM, Luc Goossens wrote:
Hi Eric (and Rob, and Ben, ...),
Sorry maybe this was not clear from my mail but I am not so much interested in possible work-arounds but in why this asymmetry exists in the first place. I mean is there a reason as to why it is the way it is, or is it just that nobody ever asked for anything else.
If the system automatically ignored "new" return values (for whatever "new" might mean), I think it would be too easy to miss return values that you don't mean to be ignoring.
Eric. _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas