problems with class initiation

Duncan Booth duncan at NOSPAMrcp.co.uk
Tue Jul 3 04:10:03 EDT 2001


"Steve Holden" <sholden at holdenweb.com> wrote in
news:JIL%6.24504$zT1.1243653 at e420r-atl3.usenetserver.com: 

> Note also that there is no logical reason why the "__init__()" method
> should be returning something. AS far as I know, nothing takes any
> notice of what __init__() returns, and it's usual to omit a return
> statement (impying a return value of None).
> 
Better than that, at least in Python 2.1 if you do return something other 
than None from __init__ you will get a TypeError: "__init__ should return 
None". So the return isn't optional, its forbidden.


-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list