[Tutor] Applications/examples of some advanced Py features, please !

Aztech Guy aztech1200@yahoo.com
Fri Jan 3 16:45:02 2003


--0-1059684377-1041630279=:8758
Content-Type: text/plain; charset=us-ascii


 

Hi Python gurus,

Can anyone please give some examples / applications of the use of the following advanced (advanced to me, at least :-) features of Python :

1. lambda

2. nested functions - a little info was given by Danny in reply to my earlier post on local-static variables, but I would like more.

3. Thoughts on implementing Interfaces in Py - a la Java interfaces.

I am, and will be doing more, on reading the docs and googling for this, but would anyway appreciate inputs from those who know this stuff.

I have a specific reason for the above questions- apart from general interest, of course -> I am planning to write a game-playing program in Py which will have features somewhat AI - ish. I don't have any background in AI; nor much in functional programming. I do understand recursion though. I suspect that some of the above 3 points will help me to write my app in a better way. though not sure, of course. Hence the request for examples.

For all of the above 3 points, I'm interested in :

 - code examples of their use

 - in what way their use makes code simpler, or maybe makes code possible that could not be written otherwise ('possible' in practical terms - I'm - vaguely - aware of the fact that all languages are supposed to be theoretically 'Turing-equivalent' or some such term - but what I mean is that if something is going to take a huge amount more code in some other language, or jumping through hoops, then I don't call it practically equivalent).

Thanks !

Az

 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
--0-1059684377-1041630279=:8758
Content-Type: text/html; charset=us-ascii

<P>&nbsp;</P>
<P>Hi Python gurus,</P>
<P>Can anyone please give some examples /&nbsp;applications of the use of the following advanced (advanced to me, at least :-) features of Python :</P>
<P>1. lambda</P>
<P>2. nested functions -&nbsp;a little info was given by Danny in reply to my earlier post on local-static variables, but I would like more.</P>
<P>3. Thoughts on implementing Interfaces in Py - a la Java interfaces.</P>
<P>I am, and will be doing more, on reading the docs and googling for this, but would anyway appreciate inputs from those who know this stuff.</P>
<P>I have a specific reason for the above questions- apart from general interest, of course -&gt; I am planning to write a game-playing program in Py which will have features somewhat AI - ish. I don't have any background in AI; nor much in functional programming. I do understand recursion though. I suspect that some of the above 3 points will help me to write my app in a better way. though not sure, of course. Hence the request for examples.</P>
<P>For all of the above 3 points, I'm interested in :</P>
<P>&nbsp;- code examples of their use</P>
<P>&nbsp;- in what way their use makes code simpler, or maybe makes code possible that could not be written otherwise ('possible' in practical terms - I'm - vaguely - aware of the fact that all languages are supposed to be theoretically 'Turing-equivalent' or some such term - but what I mean is that if something is going to take a huge amount more code in some other language, or jumping through hoops, then I don't call it practically equivalent).</P>
<P>Thanks !</P>
<P>Az</P>
<P>&nbsp;</P><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Yahoo! Mail Plus</a> - Powerful. Affordable. <a href="http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com">Sign up now</a>
--0-1059684377-1041630279=:8758--