[Tutor] Prescriptive vs descriptive docstring

2012-05-10 Thread Kal Sze
Hello, PEP 257 says that docstrings should be written in a prescriptive way (i.e. using the imperative mood) instead of a descriptive way (indicative mood). This seems like a rather odd recommendation. Since the docstring is supposed to tell the programmer *how* to use a function/method, I've alwa

Re: [Tutor] Scheme

2012-08-30 Thread Kal Sze
And this looks like a homework problem, too. It is against etiquette to just ask for the solution to homework on ANY forum, message board, or mailing list. Since it's been given to you as homework, you're supposed to give it enough thoughts, and (hopefully) come up with your solution. Even when y

Re: [Tutor] Scheme

2012-08-31 Thread Kal Sze
That's left as an exercise to the reader. On Friday, August 31, 2012, Mark Lawrence wrote: > On 31/08/2012 08:55, Alan Gauld wrote: > >> >> Now just translate that into Scheme :-) >> >> HTH >> >> > Anyone know of an application to automate Python to Scheme translation? :) > > -- > Cheers. > > Mar

Re: [Tutor] New to Python - simple question

2012-11-17 Thread Kal Sze
On 18 November 2012 07:40, Alan Gauld wrote: > On 16/11/12 17:40, Unaiza Ahsan wrote: > >> There is a function created for histogram equalization of images (called >> *histeq*), and saved in imtools.py. > > > > from PIL import Image > from numpy import * > im = array(Image.open('Tulips

Re: [Tutor] unclear topic

2013-01-14 Thread Kal Sze
On 15 January 2013 05:19, Prasad, Ramit wrote: > > Matthew Ngaha wrote: > > hey guys, this is not really a Python question. When ever im doing a > > tutorial, it could be pygame or some gui application, i usually find > > everything straight forward until the demonstration involves drawing. > > Th

Re: [Tutor] If a method has no return type?

2013-02-06 Thread Kal Sze
Dear Sunil, No method or function in Python has a *static* return type. That's because Python is by nature a dynamic language, with duck typing and dynamic dispatch. In fact, any method or function may well return any of a number of different types: def crazy_function(return_int) if r