[Tutor] Why error if method __init__ does not return none

Bob Gailer bgailer@alum.rpi.edu
Sat Mar 22 17:45:02 2003


--=======174FDF5=======
Content-Type: text/plain; x-avg-checked=avg-ok-1F6F8C2; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

At 07:13 PM 3/22/2003 +0000, ahimsa wrote:
>[snips]

The init method can contain any Python code you desire; it will execute 
when you "call the class". It can set instance and class properties, which 
can be accessed thru the newly created instance. It's just that "Return" in 
the __init__ method has no place to send to.

At 10:17 PM 3/22/2003 +0100, Gerrit Holl wrote:

>This raises an interesting question. Shouldn't it say: __init__ should
>return self...? Because _that_ is what it really does...

Interesting idea. Then it could even return something different, in which 
case calling the class would be like calling a function.

Bob Gailer
PLEASE NOTE NEW EMAIL ADDRESS bgailer@alum.rpi.edu
303 442 2625

--=======174FDF5=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-1F6F8C2
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/2003

--=======174FDF5=======--