[Python-3000] in-out parameters

Krishna Sankar ksankar at gte.net
Sat May 6 03:00:53 CEST 2006


I am tempted ;o) I used to diffenentiate between in and inout years ago in my Pascal and Ada days ... Eventhough this offer comes on a Thursday.

A few random observations:

a)	From what I gather, for some years, the pass by value and pass by reference has been dormant
	Ada has the in, out and inout. This makes sense in Ada as it has a very formal specification-body-separation paradigm. IMHO, Java punts this - primitives are "in" and objects are "inout".
b)	Of course, we can simulate "in" by a deep copy to a temp variable and then restoring the variable back before return. The "out" and "inout" do not need any special tratment.
c)	The intent, from what I can gather, is to provide a crispier expression of paratemter handling and also the ability to explicitly specify them in the interfaces. But in the world of immutable objects and deeply nestes object graphs, this is not that straight forward and most probably wouldn't be 100% elegant.
d)	One clear advantage is that this will minimize side effects and surprises/programming, eventually adding reliabliltiy to the systems developed using py.

Cheers
<k/>

> -----Original Message-----
> From: python-3000-bounces+ksankar=gte.net at python.org 
> [mailto:python-3000-bounces+ksankar=gte.net at python.org] On 
> Behalf Of Michael Chermside
> Sent: Thursday, May 04, 2006 1:50 PM
> To: rudyrudolph at excite.com
> Cc: python-3000 at python.org
> Subject: Re: [Python-3000] in-out parameters
> 
> [Rudy Rudolph writes to propose adding in-out parameters in Py3K]
> 
> Rudy:
> 
> Special offer, good this week only!
> 
> If you send me a sample piece of code using in-out parameters 
> written in any language I can understand, I will provide 
> (free of charge!) a translation into highly readable 
> idiomatic Python that doesn't use in-out parameters. I am so 
> confident of my ability to achieve in-out parameter behavior 
> cleanly in Python that I am offering to post an apology here 
> if I think any example you provide is less than clear when 
> written in a Pythonic manner.
> 
> Send to "mchermside at ingdirect.com" to collect on this offer.
> 
> They're-really-not-needed-lly yours,
> 
> -- Michael Chermside
> 
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-3000/ksankar%40gte.net


More information about the Python-3000 mailing list